none
Enitity Framework 6: Losing Stored Procedures when Generating Database from Model in Model-First Development RRS feed

  • Question

  • I am using model-first development with EF6, but every time I "Generate Database from Model" in the EDMX file, I lose my stored procedures.  Is there a way around this problem besides not saving the EDMX file after generating the SQL script with the model-first approach?

    Any insight would be appreciated!

    Thursday, March 12, 2015 2:36 AM

Answers

  • Hello smlinaz,

    >>Is there a way around this problem besides not saving the EDMX file after generating the SQL script with the model-first approach?

    Yes, it is possible to remain the store produce in SSDL and CSL sections, since model first approach uses the T4 template to generate SSDL,CSL sections and the DDL script according to the CSDL section, and since the T4 template is customized, you could modify it to meet your requirement. However, it is based on you are experienced with the workflow of Entity Framework and the T4 template, or it is not easy to process it.

    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.

    Friday, March 13, 2015 7:43 AM
    Moderator

All replies

  • I am using model-first development with EF6, but every time I "Generate Database from Model" in the EDMX file, I lose my stored procedures.  Is there a way around this problem besides not saving the EDMX file after generating the SQL script with the model-first approach?

    Any insight would be appreciated!

    Perhaps you should try posting your question in the ADO.NET Entity Framework and LINQ to Entities Forum.

    Also this link may be helpful - ADO.NET Entity Framework Resources


    La vida loca

    Thursday, March 12, 2015 7:41 AM
  • Apparently at the previous link for Entity Framework question they would like you to post at Stack Overflow using the correct Tag to post your question in. Of course you would need to sign up for Stack Overflow to ask a question in a Tag I suppose.

    CONSIDER ASKING EF QUESTIONS ON STACK OVERFLOW

    StackOverflow Tags


    La vida loca

    Thursday, March 12, 2015 8:25 AM
  • Hello smlinaz,

    >>Is there a way around this problem besides not saving the EDMX file after generating the SQL script with the model-first approach?

    Yes, it is possible to remain the store produce in SSDL and CSL sections, since model first approach uses the T4 template to generate SSDL,CSL sections and the DDL script according to the CSDL section, and since the T4 template is customized, you could modify it to meet your requirement. However, it is based on you are experienced with the workflow of Entity Framework and the T4 template, or it is not easy to process it.

    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.

    Friday, March 13, 2015 7:43 AM
    Moderator