If I have a class with a method I want protected
and internal
. I want that only derived classes in the assembly would be able to call it.
Since protected internal
means protected
or internal
, you have to make a choice. What do you choose in this case - protected
or internal
?
I want that only derived classes in the assembly would be able to call it.
Well then, you have two choices. You can make it protected, and whenever one of your customers extends your class and calls your method and you find out about it, you can write them a sternly worded letter telling them to please stop doing that. Or you can make it internal, and do code reviews of your coworkers' code to ensure that they don't use the method they're not supposed to use.
My guess is that the latter is the cheaper and easier thing to do. I'd make it internal.