private void CreateCommerceServiceDecorator(StoreServicesDecorator storeServiceDecorator, CatalogServicesDecorator catalogServicesDecorator) { if (_container.IsRegistered <ICommerceService>()) { var commerceServicesDecorator = new CommerceServiceDecorator(_container.Resolve <ICommerceService>(), new ICachedServiceDecorator[] { catalogServicesDecorator, storeServiceDecorator }); _container.RegisterInstance <ICommerceService>(commerceServicesDecorator); } }
private StoreServicesDecorator CreateStoreServicesDecorator(CacheManagerAdaptor cacheManagerAdaptor) { if (_container.IsRegistered <IStoreService>()) { var storeServiceDecorator = new StoreServicesDecorator(_container.Resolve <IStoreService>(), cacheManagerAdaptor); _container.RegisterInstance <IStoreService>(storeServiceDecorator); return(storeServiceDecorator); } return(null); }