public void AddALaboratory(LaboratoryModel laboratory) { if (labRepo.GetByDate(laboratory.Date) != null || labRepo.GetByNumber(laboratory.Number) != null) { throw new Exception("laboratory already exists"); } laboratory.Id = 0; labRepo.Add(Mapper.Map <LaboratoryDto>(laboratory)); labRepo.Save(); }
public void AddLaboratory(LaboratoryModel laboratoryModel) { _iLaboratoryRepository.Add(_iLaboratoryMapper.Map(laboratoryModel)); _iLaboratoryRepository.SaveChanges(); }
//public AttendanceService() //{ // attendanceRepository = new AttendanceRepository(); //} public void Add(LaboratoryModel laboratoryModel) { var newLaboratory = mapper.map(laboratoryModel); laboratoryRepository.Add(newLaboratory); }