C# shortcut or shorthand getter setter

后端 未结 4 1957
执念已碎
执念已碎 2020-12-29 01:31

Is there a short way to create the getter and setter in c#?

public string fname {get; set;} 

Is there short hand to generate {get; se

4条回答
  •  失恋的感觉
    2020-12-29 02:13

    yea type prop and press TAB. Visual Studio has a snippet for automatic property.

    For property with public get and private set, you can use propg and press TAB.

    For complete non auto property you can use propfull and press TAB.

提交回复
热议问题