Prevent EF 4.1 from deleting my database diagram
Is there a wa开发者_运维百科y to prevent Entity Framework Code-First from deleting my database diagrams when it is re-building my database?
Without using DropCreateDatabaseIfModelChanges
to create your database you can use SQL Migrations
http://www.hanselman.com/blog/EntityFrameworkCodeFirstMigrationsAlphaNuGetPackageOfTheWeek10.aspx. It won't drop the database and will generate alter commands (Incremental database development) . So you can keep your diagram and existing data.
精彩评论