how to run stored procedure in Entity framework

Viewed 9379

I have a Query in Database which is bringing another query in response using Json via Ajax. I have created the stored procedure which is accepting that query and bringing multiple columns.

I am not getting how to run stored procedure in entity framework.

Help needed.

Method:-

public ActionResult DropDownn(string query)
    {
        using (DynamicDBEntities db = new DynamicDBEntities())
        {
            //var dbQuery = db.Database.SqlQuery<Cust_mas>(query).ToList();
            //return Json(courseList, JsonRequestBehavior.AllowGet);
        }
    }

SP:-
alter procedure [dbo].[SP_DynamicCtrl]

@query nvarchar(1000) 
As
begin
execute sp_executesql @query;
end
2 Answers
Related