Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a set of stored procedures to be executed based on a condition.
The result will vary for each stored procedure.
How to use entity framework to execute such stored procedures?
Please help me with a sample implementation.


Thank you

Update :
I have a web api method like this :
C#
public IEnumerable<Prtl_Users_Chrt_Data> Get(int controlObjId)
     {
         return db.Database.SqlQuery<Prtl_Users_Chrt_Data>(StoredProcedure).ToList();

     }


In this "Prtl_Users_Chrt_Data" is my entity.
I wanted to use this single method to execute varied procedures with diff entity types. Seems Entity framework doesnt support such. So moving to ADO.Net.

Let me know if you have any other suggestions.
Posted
Updated 28-Oct-15 18:45pm
v3
Comments
Krunal Rohit 28-Oct-15 0:46am    
What have you tried so far ?

-KR

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900