Applies to: Visual Studio Visual Studio for Mac Visual Studio Code
This applies to:
When: You have a field that can't use
var or a code style preference to not use
Why: So you don't have to write repetitive code by repeating the type twice.
Place your caret on the field declaration.
Press Ctrl+. to trigger the Quick Actions and Refactorings menu.
Select Use 'new(…)':
Submit and view feedback for