Using aspnet mvc2 with the model auto-generated by entity framework:
Is it possible to tell entity framework to auto-annotate all fields? eg:
If database field says not null then add [Required] If DB field is a nvarchar(x) then add [StringLength(x)]
And so on?
What if the field name contains the string "email" eg CustomerEmail - can I get EF to auto-annotate that with an appropriate annotation ([Regex()] maybe)
As I understand it, if the model fields are annotated, and I use both Html.ValidationMessageFor() and use if (ModelState.IsValid) in my controller, then that is all I need to do to have basic clientside input validation working?
Thanks