コード例 #1
0
        public ActionResult DeleteConfirmed(int?id)
        {
            int i = db.Delete(id);

            if (i > 0)
            {
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View());
            }
        }
コード例 #2
0
        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)));
        }
コード例 #3
0
 public void Delete(int id)
 {
     Context.Delete(id);
 }