public ActionResult Delete(int id) { var apiResult = TryExecute(() => { _shiftRepository.Delete(id); _unitOfWork.Commit(); return(true); }, "Shift deleted sucessfully"); return(Json(apiResult, JsonRequestBehavior.AllowGet)); }
public IActionResult DeleteShift(long id) { Shift a = Shift_repo.Find(id); if (a == null) { return(NotFound()); } Shift_repo.Delete(a); return(Ok()); }
public ActionResult <CommonResponeModel> Delete(long Id) { int result = shiftRepository.Delete(Id); if (result > 0) { Result = new SuccessResultFactory().Factory(ActionType.Delete); } else { Result = new ErrorResultFactory().Factory(ActionType.Delete); } return(GetCommonRespone()); }
public IActionResult BulkDelete(string ids) { try { var arrayIds = ids.Split(","); if (arrayIds.Length == 0) { return new ResponseResult(Response) { StatusCode = (int)StatusCodes.Status400BadRequest, ErrorMessage = "Deleting failed. No record was selected" } } .ToJsonResult(); _repository.Delete(arrayIds); return(Ok($"Successfully Deleted {arrayIds.Length} records.")); }
public IActionResult Delete([FromBody] Shift shift) { _repository.Delete(shift); return(new JsonResult(new { delete = true })); }