I'm reading several docs on validation in ASP.NET MVC
. Ignoring those that suggest to reinvent the wheel writing your own validation logic, most articles advocate the use of xVal
or Data Annotation Validators, both of which allow declarative validation through decorating models' properties(*).
I think I'll go for xVal
, as it seems to be the most suggested (and thus, I hope, supported). What puzzles me is that I'm using Linq to SQL
, and my models are declared in an automatically generated file (dbml
+ partial.cs
), containing several classes and almost 5000 lines long, so I'm not very eager to edit it, as if I change the db structure I'll have to regenerate it, loosing my changes.
Is there a way to avoid editing that file?
(*) I've also found a Validator Toolkit which also provides declarative validation and doesn't request to decorate models' properties, but the page shows 57 downloads, so I can't tell if the project is mature or not.