So let's say I want to encapsulate the field with the good ol' Edit->Refactor->Encapsulate field, since it saves quite a bit of time:
private GameSettings gameSettings;
In Visual Studio 2015, I would get:
public GameSettings GameSettings
{
get
{
return gameSettings;
}
set
{
gameSettings = value;
}
}
But with Visual Studio 2017 I get:
internal GameSettings GameSettings { get => gameSettings; set => gameSettings = value; }
Is there any way I can make it generate the old style? It looks wrong to have half the properties in one style and half in another...
I know this thread is old, but the answer can help anyone else...
You can go to Options > Text Editor > C# > Code Style > General and change "Use expression body for accessors" to "Never". So you'll get the old style.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With