I am doing transition for a project from Webforms to MVC application using Entity Framework database first approach and have database ready along with all stored procedures
I implemented it through this well explained link to use stored procedures for CUD (create, update, delete) operations for an entity in the database-first approach.
Steps I followed (concept is still unclear for me, but it worked as per my requirement), but I hope it may help someone else as well:
Added ADO Entity Data Model using Database First Approach.
Added a new Controller for my entity using "MVC5 Controller with Views using EF" option.
For the DeleteConfirmed() function, i made minor changes as below:
[HttpPost, ActionName("Delete")]
[ValidateAntiForgeryToken]
public ActionResult DeleteConfirmed(int eid,bool isdeletede)
{
emp emp1 = db.emp.Find(eid,isdeletede); //Composite Key in my Entity: Emp
// db.emp.Remove(emp_sd1);
db.sp_deleteempt1(eid); //I excluded Remove() and invoked my Stored Procedure & it worked well for me
db.SaveChanges();
return RedirectToAction("grpindex");
}