Custom Validation with MVC2 and EF4

Posted by csharpnoob on Stack Overflow See other posts from Stack Overflow or by csharpnoob
Published on 2010-05-01T11:31:38Z Indexed on 2010/05/01 11:37 UTC
Read the original article Hit count: 968

Hi, on ScottGu's Blog is an Example how to use MVC2 Custom Validation with EF4: http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx

So here the Problem:

When the Designer in VS2010 creates the Objects for the DB, along to the example you have to add [MetadataType(typeof(Person_validation))] Annotation to that class.

But when i change anything in the Designer all these Annotations are lost.

Is it possible to keep self made changes to the edmx file, or is there any better way of applying System.ComponentModel.DataAnnotations to the generated Entities?

Thanks.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about entity-framework