/// <summary></summary> public static void RegisterTypes(IUnityContainer container, UnityRegistrationLifetimeManagerType lifetimeManagerType) { container .RegisterType <IUnitOfWorkAsync, UnitOfWork>(lifetimeManagerType.ToUnityLifeTimeManager()) .RegisterType <IUnitOfWorkAsyncEx, UnitOfWorkEx>(lifetimeManagerType.ToUnityLifeTimeManager()) ; }
/// <summary></summary> public static LifetimeManager ToUnityLifeTimeManager(this UnityRegistrationLifetimeManagerType lifetimeManagerType) { switch (lifetimeManagerType) { case UnityRegistrationLifetimeManagerType.Singleton: return(new ContainerControlledLifetimeManager()); case UnityRegistrationLifetimeManagerType.PerRequest: return(new PerRequestLifetimeManager()); case UnityRegistrationLifetimeManagerType.Transient: return(new TransientLifetimeManager()); case UnityRegistrationLifetimeManagerType.NotControlled: return(new ExternallyControlledLifetimeManager()); default: return(new TransientLifetimeManager()); } }
/// <summary></summary> public static void RegisterTypes(IUnityContainer container, UnityRegistrationLifetimeManagerType lifetimeManagerType) { //container //; }
/// <summary></summary> public static void RegisterTypes(IUnityContainer container, UnityRegistrationLifetimeManagerType lifetimeMangerType) { if (lifetimeMangerType == UnityRegistrationLifetimeManagerType.ContainerControlled) { container .RegisterType <IDataContextAsync, WideWorldImportersEntities>(new ContainerControlledLifetimeManager()) .RegisterType <IUnitOfWorkAsync, UnitOfWork>(new ContainerControlledLifetimeManager()); } else if (lifetimeMangerType == UnityRegistrationLifetimeManagerType.PerRequest) { container .RegisterType <IDataContextAsync, WideWorldImportersEntities>(new PerRequestLifetimeManager()) .RegisterType <IUnitOfWorkAsync, UnitOfWork>(new PerRequestLifetimeManager()); } else { container .RegisterType <IDataContextAsync, WideWorldImportersEntities>() .RegisterType <IUnitOfWorkAsync, UnitOfWork>(); } container .RegisterType <IRepositoryAsync <City>, Repository <City> >() .RegisterType <Service.ICityService, Service.CityService>() .RegisterType <IRepositoryAsync <Country>, Repository <Country> >() .RegisterType <Service.ICountryService, Service.CountryService>() .RegisterType <IRepositoryAsync <DeliveryMethod>, Repository <DeliveryMethod> >() .RegisterType <Service.IDeliveryMethodService, Service.DeliveryMethodService>() .RegisterType <IRepositoryAsync <PaymentMethod>, Repository <PaymentMethod> >() .RegisterType <Service.IPaymentMethodService, Service.PaymentMethodService>() .RegisterType <IRepositoryAsync <Person>, Repository <Person> >() .RegisterType <Service.IPersonService, Service.PersonService>() .RegisterType <IRepositoryAsync <StateProvince>, Repository <StateProvince> >() .RegisterType <Service.IStateProvinceService, Service.StateProvinceService>() .RegisterType <IRepositoryAsync <SystemParameter>, Repository <SystemParameter> >() .RegisterType <Service.ISystemParameterService, Service.SystemParameterService>() .RegisterType <IRepositoryAsync <TransactionType>, Repository <TransactionType> >() .RegisterType <Service.ITransactionTypeService, Service.TransactionTypeService>() .RegisterType <IRepositoryAsync <PurchaseOrderLine>, Repository <PurchaseOrderLine> >() .RegisterType <Service.IPurchaseOrderLineService, Service.PurchaseOrderLineService>() .RegisterType <IRepositoryAsync <PurchaseOrder>, Repository <PurchaseOrder> >() .RegisterType <Service.IPurchaseOrderService, Service.PurchaseOrderService>() .RegisterType <IRepositoryAsync <SupplierCategory>, Repository <SupplierCategory> >() .RegisterType <Service.ISupplierCategoryService, Service.SupplierCategoryService>() .RegisterType <IRepositoryAsync <Supplier>, Repository <Supplier> >() .RegisterType <Service.ISupplierService, Service.SupplierService>() .RegisterType <IRepositoryAsync <SupplierTransaction>, Repository <SupplierTransaction> >() .RegisterType <Service.ISupplierTransactionService, Service.SupplierTransactionService>() .RegisterType <IRepositoryAsync <BuyingGroup>, Repository <BuyingGroup> >() .RegisterType <Service.IBuyingGroupService, Service.BuyingGroupService>() .RegisterType <IRepositoryAsync <CustomerCategory>, Repository <CustomerCategory> >() .RegisterType <Service.ICustomerCategoryService, Service.CustomerCategoryService>() .RegisterType <IRepositoryAsync <Customer>, Repository <Customer> >() .RegisterType <Service.ICustomerService, Service.CustomerService>() .RegisterType <IRepositoryAsync <CustomerTransaction>, Repository <CustomerTransaction> >() .RegisterType <Service.ICustomerTransactionService, Service.CustomerTransactionService>() .RegisterType <IRepositoryAsync <InvoiceLine>, Repository <InvoiceLine> >() .RegisterType <Service.IInvoiceLineService, Service.InvoiceLineService>() .RegisterType <IRepositoryAsync <Invoice>, Repository <Invoice> >() .RegisterType <Service.IInvoiceService, Service.InvoiceService>() .RegisterType <IRepositoryAsync <OrderLine>, Repository <OrderLine> >() .RegisterType <Service.IOrderLineService, Service.OrderLineService>() .RegisterType <IRepositoryAsync <Order>, Repository <Order> >() .RegisterType <Service.IOrderService, Service.OrderService>() .RegisterType <IRepositoryAsync <SpecialDeal>, Repository <SpecialDeal> >() .RegisterType <Service.ISpecialDealService, Service.SpecialDealService>() .RegisterType <IRepositoryAsync <ColdRoomTemperature>, Repository <ColdRoomTemperature> >() .RegisterType <Service.IColdRoomTemperatureService, Service.ColdRoomTemperatureService>() .RegisterType <IRepositoryAsync <Color>, Repository <Color> >() .RegisterType <Service.IColorService, Service.ColorService>() .RegisterType <IRepositoryAsync <PackageType>, Repository <PackageType> >() .RegisterType <Service.IPackageTypeService, Service.PackageTypeService>() .RegisterType <IRepositoryAsync <StockGroup>, Repository <StockGroup> >() .RegisterType <Service.IStockGroupService, Service.StockGroupService>() .RegisterType <IRepositoryAsync <StockItemHolding>, Repository <StockItemHolding> >() .RegisterType <Service.IStockItemHoldingService, Service.StockItemHoldingService>() .RegisterType <IRepositoryAsync <StockItem>, Repository <StockItem> >() .RegisterType <Service.IStockItemService, Service.StockItemService>() .RegisterType <IRepositoryAsync <StockItemStockGroup>, Repository <StockItemStockGroup> >() .RegisterType <Service.IStockItemStockGroupService, Service.StockItemStockGroupService>() .RegisterType <IRepositoryAsync <StockItemTransaction>, Repository <StockItemTransaction> >() .RegisterType <Service.IStockItemTransactionService, Service.StockItemTransactionService>() .RegisterType <IRepositoryAsync <VehicleTemperature>, Repository <VehicleTemperature> >() .RegisterType <Service.IVehicleTemperatureService, Service.VehicleTemperatureService>(); }
/// <summary></summary> public static void RegisterTypes(IUnityContainer container, UnityRegistrationLifetimeManagerType lifetimeMangerType) { //container //.RegisterType<IScenarioObjectService, ScenarioObjectServiceEx>() //; }