What is the best way to add attributes to auto-generated entities (using VS2010 and EF4)

Posted by Dani on Stack Overflow See other posts from Stack Overflow or by Dani
Published on 2011-01-06T20:40:32Z Indexed on 2011/01/09 2:53 UTC
Read the original article Hit count: 216

ASP.NET MVC2 has strong support for using attributes on entities (validation, and extending Html helper class and more).

If I generated my Model from the Database using VS2010 EF4 Entity Data Model (edmx and it's cs class), And I want to add attributes on some of the entities. what would be the best practice ? how should I cope with updating the model (adding more fields / tables to the database and merging them into the edmx) - will it keep my attributes or generate a new cs file erasing everything ?

(Manual changes to this file may cause unexpected behavior in your application.)

(Manual changes to this file will be overwritten if the code is regenerated.)

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about attributes