VS 2017 (and maybe olders versions) gives me this handy little constructor shortcut to generate a private readonly
field and assign it.
Screenshot:
This ends up generating a private member called userService
and then assigns it with:
this.userService = userService;
This goes against the code style that I use which is to name all private members with a prefix _
resulting in assignment that should look like:
_userService = userService;
How can I make it so that VS obeys this code style rule with its code generation shortcuts?
this.
because that makes programmer not buy it, consider using it. – Darlenedarline_camelCase
convention for private members. See the CoreFX C# Coding Style Guidelines, ASP.NET Core Coding Style and even Rosyln code itself...?? – Comyns