开发者

Upgrading a model from EF v1 to EF 4

开发者 https://www.devze.com 2023-03-11 04:21 出处:网络
I have a pretty large model built in EF version 1.The client wants to upgrade the model to take advantage of the foreign keys feature of version 4.

I have a pretty large model built in EF version 1. The client wants to upgrade the model to take advantage of the foreign keys feature of version 4.

Is there any way/tool to easily convert a ef v1 model 开发者_StackOverflow中文版to ef v4?


You can just change the Target Framework from .NET 3.5 to .NET 4.0, and the model will be automatically converted.
However, if you need EF v4 features like Referential Constraints, you should recreate the model from database.


after converting the project to target .net 4, If your using the ef 4.1 code fist, use this tool to recreate the entity classes.

http://blogs.msdn.com/b/adonet/archive/2011/05/18/ef-power-tools-ctp1-released.aspx

Im sure you are already aware that having an extremely large edmx model has its disadvantages. If its not too late, use this chance to move to ef 4.1 code first and leverage the poco classes to give you more control over your entities..

My experiences have proven getting away from the edmx and moving to code first as early as possible pays off quickly. You just have to ask your self the question, is the time required to retest all the Data Access Layer, worth the investment for your project.

Good luck

0

精彩评论

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