An Asp.Net Validation Framework (Part 3)
An Asp.Net Validation Framework (Part 1) An Asp.Net Validation Framework (Part 2) Unfortunately, if you’re using LINQ to SQL or the Entity Framework, you can’t add the custom attributes we need for validation. You could generate your entity model and then simply use those generated objects but you would lose the ability to use the designers. I prefer to leverage the code we’ve written. public class ValidatableOrmBase : ValidatableBase { private List<CustomPropertyAttributeListItem> customPropertyAttributes; public List<CustomPropertyAttributeListItem> CustomPropertyAttributes { get { if (customPropertyAttributes == null ) { customPropertyAttributes = new List<CustomPropertyAttributeListItem>(); } return customPropertyAttributes; } } public override bool Validate( bool clearBrokenRules) { base .Validate(clearBrokenRules);