Partial Types : One class in more than one file
Partial types are another construct that Microsoft has proposed be added to the C# language to allow a single class to be defined in more than one file. Although it is recommended that a class be stored in a single source file, sometimes it is just not practical.
Syntax:
The following code snippets are from two different .cs files. First one comes from, let us say from ClassOne.cs and other one from classTwo.cs files respectively.
public class partial class_name()
{
//some business logic stuff
}
public class partial class_name()
{
//The remaining business logic stuff
}
Benefits:
By this logic, two different programmers can work on different logic area of same class. It eases that case.
C U with some other feature in my next article...
:)
No comments:
Post a Comment