public IActionResult Get(Nullable <Int64> id) { if (id == null) { return(BadRequest(null)); } else { var model = _repository.Get(id.Value); return(Ok(model)); } }
public ActionResult <CommonResponeModel> GetAll() { Data = shiftRepository.Get().ToList(); Result = new SuccessResultFactory().Factory(ActionType.Select); return(GetCommonRespone()); }
public ActionResult Get(int id) { var apiResult = TryExecute(() => _shiftRepository.Get(id), "Shift Fetched sucessfully"); return(Json(apiResult, JsonRequestBehavior.AllowGet)); }
public bool IsShiftCreated(Shift shift) { var obj = _shiftRepository.Get().FirstOrDefault(x => x.StartTime == shift.StartTime && x.EndTime == shift.EndTime); return(obj == null ? false : true); }