public void AddToDb(List <RepSchedule> schedule) { try { foreach (var s in schedule) { RepScheduleDto repSchedule = new RepScheduleDto() { DateOfMeeting = s.DateOfMeeting, DoctorContactNumber = s.DoctorContactNumber, DoctorName = s.DoctorName, Medicine = s.Medicine, MeetingSlot = s.MeetingSlot, RepName = s.RepName, TreatingAilment = s.TreatingAilment }; _repScheduleRepo.Add(repSchedule); } } catch (Exception) { throw; } }
public void AddToDb(List <RepSchedule> schedule) { try { foreach (var s in schedule) { RepScheduleDto repSchedule = new RepScheduleDto() { DateOfMeeting = s.DateOfMeeting, DoctorContactNumber = s.DoctorContactNumber, DoctorName = s.DoctorName, Medicine = s.Medicine, MeetingSlot = s.MeetingSlot, RepName = s.RepName, TreatingAilment = s.TreatingAilment }; _log.Info("Adding schedule to database"); _repScheduleRepo.Add(repSchedule); } } catch (Exception e) { _log.Error("Error while adding schedule to database"); throw; } }