2

I want to be able to create a new stored procedure with code first using MVC5 EF6.

All resources I've found are for mapping existing stored procedures.

I have found this article that generates stored procedures for insert, update and delete.

The generated code seems to have syntax for creating stored procedures from code, but I am unsure of the proper approach for writing these on my own through code first.

To clarify on my question:

I am looking to create a new stored procedure through code, not generate stored procedures for CUD. I am not yet completely familiar with the entirety of the code first approach, so I am unsure of where I would experiment with the 'CreateStoredProcedure' function used in the linked article in order for it to generate the stored procedure on the PM 'Update-Database" command.

2
  • The link you posted has all the steps needed to accomplish this.. Commented Aug 18, 2014 at 21:46
  • The link I posted appears to generate the stored procedures, which is the majority of what I want to do, but what I am asking for is more of what is the proper manual way to create a stored procedure using code first. I can probably throw something together that works, but doesn't mean it's the right way to do it.
    – user3954235
    Commented Aug 18, 2014 at 22:08

0