I am using Visual Studio 2022 to write C# code.
When adding a property to the constructor, then click on "Quick action and refactoring" and select "create and assign field for 'session'" visual studio would create the following
public class ExampleClass
{
private ISession session;
public ExampleClass(ISession session)
{
this.session = session;
}
}
How can I change that style to use _
instead of this.
? so the generated code will then be
public class ExampleClass
{
private readonly ISession _session;
public ExampleClass(ISession session)
{
_session = session;
}
}
CodePudding user response:
You can create a .editorconfig file, which specifies your code style preferences. The VS code generation will then respect that.