[HasSelfValidation] public class Order { private int orderNo private DateTime orderDate ... [SelfValidation] public void ValidateEntity(ValidationResults Results) { if (orderDate==null) { results.AddResult(new ValidationResult("Order Date should not be null",this,orderDate, null, null)); } } }
OrderClient objOrderClient = new OrderClient(); OrderClient.Open(); Order objOrder = new Order() objOrder.OrderNo =1; ValidationResults results = Validation.Validate(objOrder); if (!results.IsValid) { foreach (ValidationResult result in results) { MessageBox.Show(result.Message); } }
ValidateEntity()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)