/// <summary> /// удаление объкта по id /// </summary> /// <param name="id">код</param> public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var personalt = await _personaltService.GetAsync(id ?? 0); if (personalt == null) { return(HttpNotFound()); } await _personaltService.DeleteAsync(personalt); return(RedirectToAction("Index")); }