// GET: Reclamation/Delete/5 public ActionResult Delete(int id) { var task = Task.Run(async() => await serviceReclamation.Delete(id)); var result = task.Result; return(RedirectToAction("Index")); }
// GET: Reclamation/Delete/5 public ActionResult Delete(int id) { string role = null; ViewData["Role"] = ""; IEnumerable <string> roles = new List <string>(); roles = ((ClaimsIdentity)User.Identity).Claims .Where(c => c.Type == ClaimTypes.Role) .Select(c => c.Value); foreach (var x in roles) { role = x; } if (role != null) { ViewData["Role"] = role; } rec.Delete(rec.GetById(id)); rec.Commit(); return(RedirectToAction("Index")); }