开发者

update conceptual model

开发者 https://www.devze.com 2023-02-21 04:10 出处:网络
I have generated EDM from DB. Later I have removed a column from a DB and once I have updated the model the pro开发者_C百科perty in entity for that column is still there. Also I have noticed that even

I have generated EDM from DB. Later I have removed a column from a DB and once I have updated the model the pro开发者_C百科perty in entity for that column is still there. Also I have noticed that even if you will change a column type and refresh the model the Entity in model is not modified. Is there a way to refresh EDM and apply changes done in DB?


DB changes will be pushed through to the conceptual model in most cases, removing a column is a special case. If the model refresh included this feature, then it might accidentally remove properties that you had added to the conceptual model independently - that would be a bad thing.

To remove an obsolete column, just highlight it in the designer and hit the delete key. You can also remove the column in the edmx file if you can handle editing CSDL.


When you update the EDM it only updates the database definition not the conceptual model. Probably you get errors afterwards complaining about a mapping failure. You still have a conceptual property that doesn't map to a database property anymore. Remember that the EDM has three parts in it. Only the first time the conceptual model is created based upon the database model and the two are linked together by the mapping model. Afterwards, when updating the EDM, only the database model is refreshed. You have to delete / redefine types of properties by hand.

0

精彩评论

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

关注公众号