Frage

Is there a shortcut or menu-option to convert a prop snippet?

 public string SomeProperty { get; set; }

to propfull snippet

private string _someProperty;
public string SomeProperty
{
get { return _someProperty;}
set { _someProperty = value;}
}

It would come in handy to add extra functionality.

War es hilfreich?

Lösung

There is nothing in Visual Studio that does this (as far as I know). Resharper has a "To property with backing field" refactoring though.

Andere Tipps

I know this was 8 Years ago but i found an answer

Go to Tools > Options

Set this to 'Never'

Then go to your property and press Ctrl + .

And choose 'Convert to full property'

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top