Reputation: 539
Given the class:
class BaseController
{
BaseView _baseView;
BaseModel _baseModel;
}
When using visual studio's suggested naming, it offers me the name base
, not baseView
. I've managed to add the _
prefix through the options, text-editor, c#, Code Style. But I cannot see how to control the proposed field name suggestion.
I was wondering if this could be controlled so it would suggest _baseView
and _baseModel
etc.
Upvotes: 5
Views: 1620
Reputation: 4562
This worked for me:
Click the "+" to add a new naming style
Fill in:
Naming Style Title: "_camelCase"
Required Prefix: "_"
Capitalization: "camel Case Name"
Select "OK"
Click the "+" to add a new Specification
In the new row select:
Specification: "Private or Internal Field"
Required Style: "_camelCase"
Severity: "Suggestion"
That's it!
Upvotes: 14