Does the visibility of a virtual method change from a protected internal to a protected violation?

Is a method change with a protected internalvisibility protectedviolation violation for external callers and class executors?

Also note that the method is virtual, so it can be overridden in derived classes.

Before:

protected internal virtual string ResolvePropertyName(string propertyName)
{
    return propertyName;
}

After:

protected virtual string ResolvePropertyName(string propertyName)
{
    return propertyName;
}
+4
source share
2 answers

Yes, this is an amazing change.

Consider code that is in the same assembly, but not in the same class or in a derived class, and which calls the method ResolvePropertyName(). If you changed accessibility from protected internalto simply protected, this code would no longer compile.

[InternalsVisibleTo]. , ( ), internal , . , internal, , .

+3

, .

  • , INSIDE ResolvePropertyName, , ResolvePropertyName, . .
  • , , , .
+1

All Articles