locked
is it possible to update an entity framework model from a database during a manual build to find issues at compile rather than run time RRS feed

  • Question

  • An entity framework model once created may be used within a visual studio solution and the code that uses it will compile quite happily. But in reality the data base that it is configured to use may be out of sync with that model. Only during execution (run time) do you see this. Within visual studio you can update a model against a database . But can this be done on the command line during a back end build process?

    I am currently carrying out a multi-solution build each night using devenv for visual studio 2010 ( we are due to upgrade to 2013 in Jan 2014 if that helps!).


    Wednesday, October 30, 2013 10:51 PM

Answers

  • Hello,

    Yes, code generation is possible using a command-line tool.

    Have a look at the link below.

    EDM Generator (EdmGen.exe): http://msdn.microsoft.com/en-us/library/vstudio/bb387165.aspx

    Another option would be to create your own T4 file that you could launch with TextTransform.exe. It would be able to take a table list as parameter and edit the EDMX file using Linq2SQL:

    http://msdn.microsoft.com/en-us/library/vstudio/bb126245.aspx

    If I have misunderstood, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Wednesday, November 6, 2013 7:51 AM
    Friday, November 1, 2013 7:44 AM

All replies

  • Hi,

    I am moving your thread into the ADO.NET Entity Framework and LINQ to Entities  Forum for dedicated support. Thanks for your understanding. 

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 31, 2013 9:24 AM
  • Hello,

    Yes, code generation is possible using a command-line tool.

    Have a look at the link below.

    EDM Generator (EdmGen.exe): http://msdn.microsoft.com/en-us/library/vstudio/bb387165.aspx

    Another option would be to create your own T4 file that you could launch with TextTransform.exe. It would be able to take a table list as parameter and edit the EDMX file using Linq2SQL:

    http://msdn.microsoft.com/en-us/library/vstudio/bb126245.aspx

    If I have misunderstood, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Fred Bao Wednesday, November 6, 2013 7:51 AM
    Friday, November 1, 2013 7:44 AM