Code Inspection: Member can be made protected (non-private accessibility)
ReSharper is smart enough to determine where a particular class member is actually being used.
If it isn’t used outside the type or derived types, ReSharper will offer to mark the member as
If the member is used in derived classes too, ReSharper will offer to mark it as
Please note that these recommendations need to be considered before being automatically applied. After all, you may be creating a public API, or you may be making types intended to be accessed in non-standard ways (e.g., reflection). In this case, constraining visibility might not be a good idea. If necessary, you can always suppress the inspection.
The best way to suppress ReSharper inspections for an implicitly used public symbol is to mark this
symbol with either
[PublicApi] attribute from
You can also suppress these inspections with any custom attribute. To do so, mark the definition of this attribute with [MeansImplicitUse] attribute.