1.
public ActionResult Delete(int id)
{
using (var cont = new db_context())
{
var emp = new Employee()
{
emp_id = id
};
cont.Entry(emp).State = System.Data.Entity.EntityState.Deleted;
cont.SaveChanges();
}
return RedirectToAction("index");
}
public ActionResult Delete(int id)
{
using (var cont = new db_context())
{
var emp = new Employee()
{
emp_id = id
};
cont.Entry(emp).State = System.Data.Entity.EntityState.Deleted;
cont.SaveChanges();
}
return RedirectToAction("index");
}
No comments:
Post a Comment