/// <summary> /// Creates a repository for the requested domain /// </summary> /// <typeparam name="T">Domain for repository</typeparam> /// <returns>Domain specific repository</returns> public IRepository Create <T>() where T : class, IDomain { var domain = _domains.OfType <T>().SingleOrDefault(); var context = new DomainUnitOfWork <T>(domain); return(new DomainRepository <T>(context, domain)); }
/// <summary> /// Provides CRUD functionality to domain and related skill set. /// </summary> public DomainService(DomainUnitOfWork domainUnitOfWork) { if (domainUnitOfWork == null) { throw new ArgumentNullException(nameof(domainUnitOfWork)); } this.domainUnitOfWork = domainUnitOfWork; }
public void GetOutPatientRegisterPersonTest() { string strStartTime = "2016-1-2"; string strEndTime = "2016-4-11"; DateTime startTime = DateTime.Parse(strStartTime); DateTime endTime = DateTime.Parse(strEndTime); BaseDataTest bst = new BaseDataTest(startTime, endTime); var iRegisterInDuration = new Mock <IRegisterInDuration>(); iRegisterInDuration.Setup(r => r.GetRegisterInDuration(bst.startTime, bst.endTime)).Returns(bst.registersList); var factory = new Mock <IDomainInnerFactory>(); factory.Setup(f => f.CreateRegisterInDuration(EnumOutPatientCategories.OUTPATIENT)).Returns(iRegisterInDuration.Object); DomainUnitOfWork uow = new DomainUnitOfWork(factory.Object); var result = new ImRegisterPerson.GetOutPatientRegisterPerson(uow).GetRegisterPerson(bst.startTime, bst.endTime); Assert.Fail(); }
/// <summary> /// Provides functionality to list employees, find employees by search criteria, update employee related data. /// </summary> public EmployeeService(DomainUnitOfWork domain, EmployeeUnitOfWork employee, IdentityUnitOfWork identity) { if (domain == null) { throw new ArgumentNullException(nameof(domain)); } if (employee == null) { throw new ArgumentNullException(nameof(employee)); } if (identity == null) { throw new ArgumentNullException(nameof(identity)); } domainUnitOfWork = domain; employeeUnitOfWork = employee; identityUnitOfWork = identity; }
public void GetDrugCategoriesNumbersTest() { string strStartTime = "2016-4-2"; string strEndTime = "2016-4-4"; DateTime startTime = DateTime.Parse(strStartTime); DateTime endTime = DateTime.Parse(strEndTime); BaseDataTest bst = new BaseDataTest(startTime, endTime); var iRegisterInDuration = new Mock <IRegisterInDuration>(); iRegisterInDuration.Setup(r => r.GetRegisterInDuration(bst.startTime, bst.endTime)).Returns(bst.registersList); var factory = new Mock <IDomainInnerFactory>(); factory.Setup(f => f.CreateRegisterFromPrescription(EnumOutPatientCategories.OUTPATIENT_EMERGEMENT)).Returns(iRegisterInDuration.Object); DomainUnitOfWork uow = new DomainUnitOfWork(factory.Object); var getDrugCategory = new ImGetDrugCategoriesNumbers(uow); var result = getDrugCategory.GetDrugCategoriesNumbers(bst.startTime, bst.endTime); Assert.AreEqual(result, -2); }
public ImTopTenAntibioticDepRank() { this.uow = new DomainUnitOfWork(); }
public GetOutPatientRegisterPerson(DomainUnitOfWork uow) { this.uow = uow; }
public GetOutPatientRegisterPerson() { this.uow = new DomainUnitOfWork(); }
public GetEmergencyRegisterPerson(DomainUnitOfWork uow) { this.uow = uow; }
public GetEmergencyRegisterPerson() { this.uow = new DomainUnitOfWork(); }
public ImDrugTopThirtyRank(DomainUnitOfWork uow) { this.uow = uow; }
public ImGetDrugCategoriesNumbers(DomainUnitOfWork uow) { this.uow = uow; }
public ImGetOutPatientEmergencyCost() { this.uow = new DomainUnitOfWork(); }
public ImGetEssentialDrugCategoryNumbers() { this.uow = new DomainUnitOfWork(); }
public ImTopTenAntibioticDepRank(DomainUnitOfWork uow) { this.uow = uow; }
public GetOutPatientEmergencyAntibioticPerson(DomainUnitOfWork uow) { this.uow = uow; }
public GetOutPatientEmergencyAntibioticPerson() { this.uow = new DomainUnitOfWork(); }
public GetOutPatientEmergencyAntibioticCategoryNumber(DomainUnitOfWork uow) { this.uow = uow; }
public GetOutPatientEmergencyAntibioticCategoryNumber() { this.uow = new DomainUnitOfWork(); }
public ImOutPatientEmergencyPrescriptionMessage() { this.uow = new DomainUnitOfWork(); }
public ImOutPatientEmergencyPrescriptionMessage(DomainUnitOfWork uow) { this.uow = uow; }
public ImGetEssentialDrugCategoryNumbers(DomainUnitOfWork uow) { this.uow = uow; }
public ImDrugTopThirtyRank() { this.uow = new DomainUnitOfWork(); }
public ImGetOutPatientEmergencyCost(DomainUnitOfWork uow) { this.uow = uow; }
public ImGetDrugCategoriesNumbers() { this.uow = new DomainUnitOfWork(); }