locked
Update Model from EF v1 to EF v4 RRS feed

  • Question

  • I have a rather extensive model already created (roughly 30 entities) and in production.  We are embarking on a new iteration and I'd like to upgrade the model to EF v4.  Will I need to go through all the initial steps to create the model, change all the names add all the inheritance, etc...Or is there an easy way to upgrade my model without loosing all my settings?

    Thanks!

    Thursday, April 22, 2010 6:00 PM

Answers

  • Hi,
    Since I lately upgraded my models from EF1 to EF4 the answer is simple.
    First backup the model.
    Then you should change the target framework of the project you've built to .Net framework 4.
    After that you need to check whether things are working as expected.

    I hope it will help you.
    Gil Fink
    • Marked as answer by paully21 Sunday, April 25, 2010 1:42 PM
    Friday, April 23, 2010 7:16 AM
  • Hi Paul,

    I tried at my lab as well and it seems we need to change the Independent Associations to the FK Associations manually as you said.   After we open .NET 3.5 SP1 projects in VS2010, the target framework is set to 3.5 automatically.   We need to set it to 4.0 as Gil suggested.   Then everything in the EDM is working fine.  

    BTW, I have noticed that you have contributed lots of helpful answers in EF forums.  Some of them are marked as answer by me.  J   I’d like to take this opportunity to say thank you, Paul, for your great work in EF forums.    

    Have a nice weekend, both!


    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by paully21 Sunday, April 25, 2010 1:41 PM
    Saturday, April 24, 2010 9:32 AM

All replies

  • Hi,
    Since I lately upgraded my models from EF1 to EF4 the answer is simple.
    First backup the model.
    Then you should change the target framework of the project you've built to .Net framework 4.
    After that you need to check whether things are working as expected.

    I hope it will help you.
    Gil Fink
    • Marked as answer by paully21 Sunday, April 25, 2010 1:42 PM
    Friday, April 23, 2010 7:16 AM
  • Thanks Gil.

    I guess what I really want is to be able to automatically ad the Foreign Keys to the model.  Or ASP.NET developers could really use this feature to be on the entities.

    I tried the Include Foreign...checkbox, but it didn't add them.  I guess I'll have to each one by hand :(

     

     

     

     

    • Marked as answer by paully21 Sunday, April 25, 2010 1:42 PM
    • Unmarked as answer by paully21 Sunday, April 25, 2010 1:42 PM
    Friday, April 23, 2010 10:52 PM
  • Hi Paul,

    I tried at my lab as well and it seems we need to change the Independent Associations to the FK Associations manually as you said.   After we open .NET 3.5 SP1 projects in VS2010, the target framework is set to 3.5 automatically.   We need to set it to 4.0 as Gil suggested.   Then everything in the EDM is working fine.  

    BTW, I have noticed that you have contributed lots of helpful answers in EF forums.  Some of them are marked as answer by me.  J   I’d like to take this opportunity to say thank you, Paul, for your great work in EF forums.    

    Have a nice weekend, both!


    Best Regards,
    Lingzhi Sun

    MSDN Subscriber Support in Forum

    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by paully21 Sunday, April 25, 2010 1:41 PM
    Saturday, April 24, 2010 9:32 AM
  • Yep...I ended up just recreating the model.  It would be cool if someone could write a tool to automate that process.

    No problem...I love doing it.  In fact, I was in the same boat years ago when Julie Lerman, John Papa, Diego and Colin all helped me. Just trying to help developers use, what I think is, a great technology.

    Paul

    Sunday, April 25, 2010 1:41 PM