Partial Classes and Methods
Learn to split a single class across multiple files.
We'll cover the following...
We'll cover the following...
Partial classes
There is a C# feature that allows us to split class definition into multiple locations or files. Using the partial keyword, we inform the compiler that the class source code is located in multiple places:
Partial classes are a C# compiler feature. Partial class definitions are assembled together before they’re compiled to IL code:
public partial class C
{
public void M()
{
}
}
public partial class C
{
public void K()
{
}
}
The code above compiles ...