How do I generate a constructor from class fields using Visual Studio (and/or ReSharper)?

前端 未结 12 1808
有刺的猬
有刺的猬 2020-11-27 12:54

I\'ve gotten accustomed to many of the Java IDEs (Eclipse, NetBeans, and IntelliJ IDEA) providing you with a command to generate a default constructor for a class based on t

12条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 13:53

    You can do this easily with ReSharper 8 or later. The ctorf, ctorp, and ctorfp snippets generate constructors that populate all the fields, properties, or fields and properties of a class.

提交回复
热议问题