How to create a stored procedure with the model fist approach? RRS feed

  • Question

  • Hello,

    in my current project, I am using the model fist approach.
    I now need some stored procedures in my database.

    What would be best way to get that done?


    Thursday, August 16, 2012 6:31 AM


  • Hi Rainer Queck,

    Welcome to MSDN Forum.

    I'm afraid model first will not help you to create stored procedures in database. Because stored procedures are logic defined in the database, Entity Framework has no knowledge of them, so it couldn't help you to create them. You can create the database from the models, then create stored procedures in the database, after that, update the models from the database, this is, you can add the stored procedures which you have created to the designer. Finally, import the stored procedures as the functions in Entity Framework. : )

    Best Regards

    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Friday, August 17, 2012 1:49 AM