public ActionResult DeleteConfirmed(int?id) { int i = db.Delete(id); if (i > 0) { return(RedirectToAction("Index")); } else { return(View()); } }
public async Task <IActionResult> DeleteConfirmed(int id) { EmployeeContext context = HttpContext.RequestServices.GetService(typeof(Employees.Models.EmployeeContext)) as EmployeeContext; if (ModelState.IsValid) { context.Delete(id); ViewData["search"] = ""; ViewData["page"] = 0; ViewData["prevPage"] = -1; ViewData["nextPage"] = 1; } return(View("List", context.GetSomeEmployees(0))); }
public void Delete(int id) { Context.Delete(id); }