Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Initialize All Properties from Constructor
Initialize All Properties from Constructor

Initialize All Properties from Constructor

Venkatesh Muniyandi

|
109 installs
| (0) | Free
Extension to initialize all properties from a constructor, Developed by Venkatesh Muniyandi
Download

This extension helps to initialize all the properties from the constructor. Default behavior offered in Visual Studio is to initialize a single property from the constructor, there is no default option to initialize all the existing properties from a constructor. This extension comes in handy when anyone wants to move from property-based injection to constructor-based injection.

This extension will modify the constructor to add additional arguments to initialize the properties, and also it provides an additional code fix that helps to mark the properties as private.

Note: Open Image in a new tab by right-clicking on animated GIF to view it fullscreen

Scenario 1: Constructor Not Exists

Constructor_NotExists.gif

Scenario 2: Partial Constructor Exists

PartialConstructorExists.gif

Scenario 3: Optional Code Fix to make the properties private after initializing it from constructor

PartialConstructorExists_MakeitPrivate.gif

Scenario 4: Apply the fix across solution

Solution_Level_Change.gif

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft