please briefly explain me about partial class with some suitable example and image.
Define Partial class in MVC.
374
22-Jan-2020
Updated on 22-Jan-2020
Nishi Tiwari
22-Jan-2020A partial class can be defined as the class that can be split among multiple physical files. This feature came in C# 2.0. The partial class break the definition of class into two or more than two class files, but it will be together at compile time as one class.
Every class in C# resides in a separate physical file with a .cs extension. C# provides an ability to have a single class implementation in multiple .cs files using the partial modifier keyword. The partial modifier can be applied to any class, method, interface or structure.
For example, this MyPartialClass splits into two files, PartialClassFile1.cs and PartialClassFile2.cs:
Example:
PartialClassFile1.cs