C# shortcut or shorthand getter setter

Yogurt The Wise picture Yogurt The Wise · Nov 4, 2011 · Viewed 68.9k times · Source

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; set;}?

Answer

Muhammad Hasan Khan picture Muhammad Hasan Khan · Nov 4, 2011

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.