Visual Studio 2017 introduced code refactoring to simplify object initialization. Let’s say we have following class called Bar.
And here is how this class is consumed.
Notice the Gray dots under the new keyword in this picture. This is an indication that there is some code refactoring available. In order to view it, just click the Ctrl+. and it will bring up following pop-up.
As you can see in this image, the suggested change is to initialize the BarId and BarName properties using Object Initializer. If you choose to apply this suggestion, the updated code will look as follows.
Until next, happy debugging.