Hi Everyone,
I'm developing an ASP.NET MVC application. I'm coding an Index action of the account controller whose code is:-
var jobPostings = context.Database.SqlQuery<EGB_JOBPOSTINGS>("EXEC EGB_GETACTIVEJOBPOSTINGS @jobID", new SqlParameter("jobID", 2));
ViewBag.JobInfo = new SelectList(jobPostings, "JobID");
return View();
My problem is that, I want to use the stored procedure EGB_GETACTIVEJOBPOSTINGS with Entity Framework using Raw SQL Queries as using SqlQuery. That Stored Procedure getting data from multiple tables through multiple joins. I want to ask that how can I get
the result of the stored procedure while SqlQuery uses only EGB_JOBPOSTINGS class (causes a runtime exception) which is not the only object that Stored Procedure returns.
So what is the optimum way to get through? or How to solve this? Or is there any alternative approach
Thanks
Go to the complete details ...