开发者

"how update entities in mvc2 whereas database update"

开发者 https://www.devze.com 2023-03-15 00:00 出处:网络
I made project in mvc2. I made database in Sql server. I am fetching data through entityframework. Then I made entities, and some controller classes.

I made project in mvc2.

I made database in Sql server.

I am fetching data through entity framework. Then I made entities, and some controller classes.

Now when i add one more table in database, and deploy to server then the entities are showing of the old tables

so please开发者_如何学C how i also update entities without reconstruct entities

Thanks in advance.


It sounds like you are talking about data migration after a model change. This is not currently support. You can how ever create a custom database initializer and override the seed methods to manually migrate data.

Or simpler do not initialize the database and make the changes to the data model through SSMS


You can take advantage of some of the features of "Code First" in EF4.1 to create entities to match your database, even if you don't use it to create your database. That way the entities will automatically be created from your classes.

Using EF Code First With an Existing Database

0

精彩评论

暂无评论...
验证码 换一张
取 消