hi,
i want to use stored procedure in entity framework with returning list.but i got error in model.context class i.e isingleresult cannot convert
into list .please give me solution .its urgent
thanks in advance
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 18, 2014, 7:21 PM EDT
Hi,
I am not sure what you do in coding...
Please refer my article
http://www.c-sharpcorner.com/UploadFile/ff2f08/call-store-procedure-from-entity-framework/
http://www.c-sharpcorner.com/UploadFile/ff2f08/code-first-stored-procedure-entity-framework-6-0/
hope this will help you.
saswat kumar167 reputationPosted Sep 18, 2014, 9:17 PM EDT
Thanks for ur response.please check my code . i m not able to find where is the mistake i have done.In my code, my stored procedure name is getdata() and table name is emp.In modelbrowser, I set return type to entity:emp.my business logic code is
public List
{
MYDBEntities obj = new MYDBEntities();
var x = from n in obj.getdata
return x.ToList
}
i find error that stored procedure getdata() is a nongeneric method.in model.conext.cs,
the return type is not changed after setting return type to entity:emp.
thanks in advance