Lets Have a fun with Technology.


Follow by Email

Wednesday, January 27, 2016

Call Stored Procedure from Entity Framework

First Create an edmx file.

Double click your edmx file and right click your model,Choose Function Import In the pop-up dialog,

Choose the SP that you want to import as a function.

Now you can use it through the database Context like below.

using (EntityContext ec = new EntityContext())


    ec.StoredProcdure here(Parameters);


You can also refer below articles for same.

For Database First / Model First you can set up EF to call the SPs automatically:


For Code First you have to call them manually:



Post a Comment