You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The only fields an application should have are private and protected. public and internal fields should be a property instead. The only exception here is when they are const or static readonly.
This stems from the idea of encapsulation: outside members should access private and protected fields through a method to allow for validation.
Provide a CodeFix which makes the field private and adds a public or internal property, depending on what the field was defined as.
The text was updated successfully, but these errors were encountered:
The only fields an application should have are
private
andprotected
.public
andinternal
fields should be a property instead. The only exception here is when they areconst
orstatic readonly
.This stems from the idea of encapsulation: outside members should access private and protected fields through a method to allow for validation.
Provide a CodeFix which makes the field
private
and adds apublic
orinternal
property, depending on what the field was defined as.The text was updated successfully, but these errors were encountered: