私有保护和内部保护的区别
Difference between private protected and internal protected
C# 7.2 引入了 private protected
修饰符,与 internal protected
有什么区别?
来自文档:
A private protected member is accessible by types derived from the containing class, but only within its containing assembly.
这不正是 internal protected
所做的吗?
来自Access Modifiers (C# Programming Guide)
Protected Internal : The type or member can be accessed by any code in
the assembly in which it is declared, or from within a derived class
in another assembly.
和
Private Protected : The type or member can be accessed only within its
declaring assembly, by code in the same class or in a type that is
derived from that class.
另一个有用的linkC# 7 Series, Part 5: Private Protected
C# 7.2 引入了 private protected
修饰符,与 internal protected
有什么区别?
来自文档:
A private protected member is accessible by types derived from the containing class, but only within its containing assembly.
这不正是 internal protected
所做的吗?
来自Access Modifiers (C# Programming Guide)
Protected Internal : The type or member can be accessed by any code in the assembly in which it is declared, or from within a derived class in another assembly.
和
Private Protected : The type or member can be accessed only within its declaring assembly, by code in the same class or in a type that is derived from that class.
另一个有用的linkC# 7 Series, Part 5: Private Protected