Skip to content

Partial Classes

Mario Gutierrez edited this page Jan 7, 2017 · 1 revision

The partial keyword allows classes to be split among multiple files. The file names don't matter, only that the class name and namespace are the same.

This is one way you could split things up:

// Cookie.cs
partial class Cookie
{
  // Methods
  // Properties
}
// Cookie.Boilerplate.cs
partial class Cookie
{
  // Field data
  // Constructors
}
Clone this wiki locally