public IHttpActionResult DeleteMovement(int id) { try { _service.Delete(id); return(Ok()); } catch (ObjectNotFoundException e) { return(BadRequest(e.Message)); } }
public async Task <ActionResult> Delete(int Id) { try { await _service.Delete(Id); return(RedirectToAction(nameof(Index))); } catch (NotFoundException e) { TempData["ErrorMessage"] = e.Message; return(new HttpStatusCodeResult(HttpStatusCode.NotFound, e.Message)); } catch (DbUpdateException e) { TempData["ErrorMessage"] = e.Message; return(new HttpStatusCodeResult(HttpStatusCode.InternalServerError, e.Message)); } }
public void Delete(string id = "3c3d9d1b-2168-4175-85b3-fb8d7a4062bc") { _movementService.Delete(new System.Guid(id)); }