Local type
In C #1.0, a class can only be placed in one file. In C #2.0, a keyword "partial" is used to divide a class into two parts [that is, the implementation of a class can be in multiple files]. The compilation result is exactly the same as that written in a file. More significance lies in engineering management.
The value of the local type is applicable to interfaces, classes, or structures. enumeration is not supported. [generally, enumeration is not so large.]
Each part of the same type must have a modifier partial, which must be in the same namespace and must be compiled and accessed simultaneously;
The keyword partial is a context keyword. It indicates a keyword only when it is put together with class, struct, and interface;
The features and interfaces of local types have a cumulative effect;
If one part of a type uses the abstract modifier, the entire class will be treated as an abstract class;
If a part of a type uses the sealed modifier, the entire class is regarded as a sealed class;
Different parts cannot use conflicting modifiers. For example, abstract and sealed cannot be used on one part;
The base classes specified on each part must be consistent. Some parts do not specify the base class, but if they are specified, they must be the same.
Attribute accessors Protection Level
C #2.0 allows get and set accessors of an attribute to use different access level modifiers [Note the concept of attribute accessors and attributes].
The access modifier on the property accessors (get or set) must be stricter than the access modifier of the property;
You can only specify the access modifier on one property accessor (get or set), and the other uses the access modifier of the property by default;
The attribute in the interface can only be public by default, and the access modifier of the property accessor (get or set) cannot be set.
Namespace alias qualifier
C #2.0 allows the namespace alias qualifier (: :) to avoid type conflicts in different namespaces. When the namespace alias qualifier (: :) the compiler can ensure that this is a qualifier for "namespace alias" only [view the code in IL Code :], it is not classified as another type or a member qualifier (.). The keyword global can be placed on the left of the namespace alias qualifier (: :), which allows the compiler to only search for all namespaces, rather than other types or members. Use the namespace alias qualifier (: :) as much as possible, and reduce the use of general qualifiers such as dot (.) [Accelerate the compiler search type, no difference after compilation].