Can I split my C# class across multiple files?

Yes, you can use partial classes. This allows you to split your class over multiple files.

File 1:

public static partial class ReferenceData
{
    /* some methods */
}

File 2:

public static partial class ReferenceData
{
    /* some more methods */
}

Use this feature carefully. Overuse can make it hard to read the code.

Leave a Comment

tech