Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partial Classes in C#

Are there are good uses of Partial Classes outside the webforms/winforms generated code scenarios? Or is this feature basically to support that?

like image 648
Brian G Avatar asked Oct 02 '08 01:10

Brian G


1 Answers

It is in part to support scenarios (WebForms, WinForms, LINQ-to-SQL, etc) mixing generated code with programmer code.

There are more reasons to use it. For example, if you have big classes in large, unwieldy files, but the classes have groups of logically related methods, partial classes may be an option to make your file sizes more manageable.

like image 91
yfeldblum Avatar answered Oct 08 '22 01:10

yfeldblum