How to call store procedure form entity framework? [Resolved]

Posted by Allemahesh under ASP.NET on 7/18/2013 | Points: 10 | Views : 1248 | Status : [Member] [MVP] | Replies : 2
How to call store procedure form entity framework?




Responses

Posted by: Jitendrasoft09 on: 7/19/2013 [Member] [MVP] Starter | Points: 50

Up
0
Down

Resolved
Hi,

You can call SP from entity framework with the below code-

var products = from p in entities.uspGetProductsWithListPriceGreaterThan(value)

select p;

OR,
using (EntityContext ec = new EntityContext())

{
ec.YourStoredProcdure's FunctionName here(Parameters……);
}


Refer below link for more information-
http://chsakell.wordpress.com/2013/04/08/call-a-stored-procedure-using-the-entity-framework/

Jitendra Kumar
If my post helps you, plz mark as an answer.

Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Allemahesh on: 7/22/2013 [Member] [MVP] Silver | Points: 25

Up
0
Down
Dear Jitendra,
This is very help full for me.
Thanks for giving this answer.


Allemahesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response