vijay kumar

vijay kumar

  • NA
  • 22
  • 19k

MVC4 CRUD with ASPX view Engine & Entity Framework

Apr 22 2014 11:54 PM
I wanted to do CRUD (create,Retrieve,Update and Delete) operations using 
ASP.Net MVC 4 with ASPX view engine & Entity framework(.edmx file extension)
 
I wrote for Showing the data and Inserting it to the Database.
 
Please tell me how to do it for Update and Delete operations
 
NorthwindEntities obj = new NorthwindEntities();
public ActionResult Cateview()
{
ViewData["Cate"]=obj.Categories.ToList();
return View();
}
public ActionResult InsertCateview()
{
return View();
}
[HttpPost]
public ActionResult InsertCateview([Bind] Category objcate)
{
obj.Categories.Add(objcate);
obj.SaveChanges();
return RedirectToAction("Cateview", "Cate");
}
 

Answers (3)