Automatically Infer MVC Validation Rules Based on LINQ to SQL Schema

added by goneale
8/26/2010 11:29:48 PM


Hey gang, just a quickie today. I have been working recently on setting up server side and client side model validation “by the book” in ASP.NET MVC 2 complete with data annotations and the first question that hit me when I was declaring attributes on my LINQ to SQL partial classes to determine model validation was “hold on, surely there is a way to automagically have MVC infer my validation rules based on my database schema…”