Shortcut to instantiate an object in Visual Studio

前端 未结 4 1495

I have a class with more than 8 properties, and I often want to instantiate it in some method, but it is super tedious to have to write the properties one by one to assign t

4条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 18:25

    I've created the Generate an initializer for a new object with names of public properties and fields command for the Visual Commander extension. Call it after entering the class name and it will generate an initializer:

提交回复
热议问题