0

How to call stored procedure through code first appraoch/DBCONTEXT file.

In code first appraoch, we can create tables and relationship through Model object but, have to create procedures manually into database or any approach avaibale to generate ?

How to call procedure ?

Thank You

user3711357
  • 1,425
  • 7
  • 32
  • 54
  • There is no automated, out-of-the-box, way to do what you want. After all, where would you put the SP code, in an attribute somewhere? I would use EF migrations and create/alter/drop SPs and views in the Up and Down methods. – Jeremy Cook Jul 23 '14 at 14:48
  • Ok, I have already existed some of procedure into database. How can i call through EF (dbcontext) object ? – user3711357 Jul 24 '14 at 05:54
  • This SO article should help: http://stackoverflow.com/questions/20901419/how-to-call-stored-procedure-in-entity-framework-6-code-first – Jeremy Cook Jul 24 '14 at 13:34

0 Answers0