Partial classes give you the ability to split a class into more than one source code .cs file.
If a class becomes particularly long and intricate you might decide to break it into pieces as shown below
//This file is stored in the Product.cs
public partial class Product
{
private string name;
private decimal price1;
public string Name
{
}
public decimal Price
{
}
public string ImageUrl
{
}
}
public partial class Product
{
//continued code here
}
these two partial classes comprise one class Product and are divided to simplify coding.
If a class becomes particularly long and intricate you might decide to break it into pieces as shown below
//This file is stored in the Product.cs
public partial class Product
{
private string name;
private decimal price1;
public string Name
{
}
public decimal Price
{
}
public string ImageUrl
{
}
}
public partial class Product
{
//continued code here
}
these two partial classes comprise one class Product and are divided to simplify coding.