Wednesday, November 14, 2012

Partial class and partial method in C#

Partial class with partial method declaration:
partial class MyPartialClass
{
  ...
  partial void ValidateInput(decimal amount);
}
Partial class with partial method body:
partial class MyPartialClass
{
  ...
  partial void ValidateInput(decimal amount)
  {
    if (amount> 100)
      throw new ArgumentException ("Too Big");
  }
}
 
 
 
from w3mentor 

No comments:

Post a Comment