public bool Add(Lab item) { if (_labRepository.GetSingleById(item.Id) == null && !_labRepository.Exists(m => m.Name.Trim().ToUpper() == item.Name.ToUpper())) { item.CreatedDate = DateTime.Now; _labRepository.Add(item); } return(true); }
public async Task <object> PostLabModel(LabInputModel labModel) { object result; if (await _labRepository.GetByName(labModel.Name) == null) { result = await _labRepository.Add(labModel); } else { result = "bad request"; } if (result.Equals("bad request")) { return(BadRequest()); } else { return(result); } }
public void createLab(LabMaster labmaster) { _labRepository.Add(labmaster); _unitOfWork.Commit(); }