A simple, yet time consuming aspect of developing in C# is creating property initializers. I know, you are a wizard with typing, or even using code snippets. However, C# 6.0 just made it even more simple.
So, if you were to code up a property initializer by hand, it would look something like this in C# 5.0:
You will notice above that we have to initialize the properties in the constructor. Well, check this out, with C#6.0, we can do it all on one line:
Pretty awesome huh? Saves some time for sure. Now, add your keyboard shortcut to creating properties, using the prop snippet, and time will stand still.
I hope you enjoyed this post. If so, please share it with others! Keep your eyes posted for more C# Tips and Tricks coming soon…