In C# the internal keyword can be used on a class or its members.
Today I will show you how to use the internal accessibility level with members of the class.
All types and type members have an accessibility level. The accessibility level controls whether they can be used from other codes in your assembly or other assemblies.
I can declare a class as internal or its member as internal.
Internal members are accessible only within files in the same assembly – the DLL file.
In other words, a protected internal member is accessible from any class in the same assembly, including derived classes.
The accessibility level controls for internal are:
internal: The type or member can be accessed by any code in the same assembly, but not from another assembly.
protected internal: The type or member can be accessed by any code in the assembly in which it’s declared, or from within a derived class in another assembly.
See the documentation webpage for Access Modifiers …
Let see one simple example:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Translate »