public AbstractDomainModel Get(AbstractDomainModel domainModel) { staff = (Staff)domainModel; List <CareHub.DataModel.Models.Provider> practiceDoctors = null; List <CareHub.DataModel.Models.Provider> practiceStaff = null; switch (staff.OperationType) { case 11: practiceDoctors = providerRepository.GetAllDoctorsByProviderPractice(); if (practiceDoctors != null) { staff.PracticeDoctors = practiceDoctors; } else { throw new Exception("Doctors not found"); } break; case 12: practiceStaff = providerRepository.GetAllStaffByProviderPractice(); if (practiceStaff != null) { staff.PracticeStaff = practiceStaff; } else { throw new Exception("Doctors not found"); } break; default: break; } return(staff); }