public virtual ActionResult Delete(int id) { try { var model = _stageService.Find(id); if (model == null) { return(HttpNotFound()); } _stageService.Delete(id); Log log = new Log() { UserId = int.Parse(User.Identity.GetUserId()), Operation = Operations.مراحل, OperationDetail = OperationsDetail.حذف, Description = " حذف مرحله به شماره" + id }; _logService.AddNewLog(log); _unitOfWork.SaveChanges(); return(Json(new { isError = false, Msg = "حذف شد" })); } catch (Exception) { return(Json(new { isError = true, Msg = "خطا در عملیات حذف مرحله " })); } }
public async Task <ActionResult <StageDTO> > DeleteStage(int id) { var stage = await _stageService.GetById(id); if (stage == null) { return(NotFound()); } stage = await _stageService.Delete(stage); if (stage == null) { return(NotFound()); } return(_mapper.Map <StageDTO>(stage)); }
public IActionResult Delete([FromHeader] string eventId, [FromRoute] string stageId) { _stageService.Delete(eventId, stageId); return(Ok()); }