Using DataAnnotations with Entity Framework

前端 未结 2 1525
余生分开走
余生分开走 2020-11-27 07:31

I have used the Entity Framework with VS2010 to create a simple person class with properties, firstName, lastName, and email. If I want to attach DataAnnotations like as is

2条回答
  •  抹茶落季
    2020-11-27 07:53

    You need to either use a metadata "buddy" class or (my preference) project onto a presentation model instead of binding views directly to entities.

提交回复
热议问题