DisplayName on Model that use Entity Framework

I have a code that look like this :

public class MyModel
{
    [Required]
    [Display(Name = "labelForName", ResourceType = typeof(Resources.Resources))]
    public string name{ get; set; }
}

The problem is the attribute Display and Required have been added in the generated model class of Entity Framework. I know I can add functionality with Partial but how can I add attribute to a class that will be erase and updated with the ORM?

6
задан Patrick Desjardins 4 May 2011 в 20:19
поделиться