Interview Tips Interview Tips, Interview Questions and Answers

11Sep/100

What is partial classess in .net?

When there is a need to keep the business logic separate from the User Interface or when there is some class which is big enough to have multiple number of developers implement the methods in it, the class can be separated and written in different files as partial class.

The keyword partial must appear in each class.

//syntax for C#
Public partial class MyPartialClassOne
{
         //code
}

// this code could be in one file

Public partial class MyPartialClassOne
{
         //code
}
// this code could be in another file

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.