I have a class that is internal by itself, so the following difference in declaration has no real-world consequence but I would like to understand the mechanics behind it.
I have a property like this:
public String CreditedAs { get; protected set; }
and it compiles just fine. The getter can be read by anyone that has access to the class, the setter only within the class or classes derived by it.
Now when I try this:
internal String CreditedAs { get; protected set; }
I get
The accessibility modifier of the '{class}.CreditedAs.set' accessor
must be more restrictive than the property or indexer '{class}.CreditedAs'
Why is that? And
protected String CreditedAs { internal get; set; }
doesn't work either.