Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF6 Database First making Stored Procedure Async

What's the right way to run a EF6 stored procedure (database-first) in async mode?

I read about ToListAsync() but I don't see that available on stored procedure.

Also not sure if there is a different way to call the stored procedure when the actual call returns (#1) an OUT param or a (#2) list of items:

Case #1

 using (DBContext db = new DBContext())
 {
     ObjectParameter result = new ObjectParameter("Result", 
                                  typeof(global::System.Boolean));

     db.Login("[email protected]", "password", result);
 }

Case #2

 using (DBContext db = new DBContext())
 {
     var result = db.Contact_GetList("New York");
 }

Thanks for the help

like image 855
SF Developer Avatar asked Jul 20 '26 16:07

SF Developer


1 Answers

As per this workitem you would need to use SqlQueryAsync. Feel free to upvote the work item on the EF Codeplex site.

like image 67
Pawel Avatar answered Jul 22 '26 11:07

Pawel