/// <summary> /// Ctor /// </summary> /// <param name="cacheManager">Cache manager</param> /// <param name="categoryRepository">Category repository</param> /// <param name="productCategoryRepository">ProductCategory repository</param> /// <param name="productRepository">Product repository</param> /// <param name="aclRepository">ACL record repository</param> /// <param name="storeMappingRepository">Store mapping repository</param> /// <param name="workContext">Work context</param> /// <param name="storeContext">Store context</param> /// <param name="eventPublisher">Event publisher</param> /// <param name="storeMappingService">Store mapping service</param> /// <param name="aclService">ACL service</param> /// <param name="catalogSettings">Catalog settings</param> public CategoryDomainService(ICacheManager cacheManager, ICategoryRepository categoryRepository, IProductCategoryRepository productCategoryRepository, IProductRepository productRepository, //IRepository<AclRecord> aclRepository, IStoreMappingRepository storeMappingRepository, //IWorkContext workContext, IStoreContext storeContext, //IEventPublisher eventPublisher, StoreMappingDomainService storeMappingService, //IAclService aclService, SettingDomainService settingDomainService) { this._cacheManager = cacheManager; this._categoryRepository = categoryRepository; this._productCategoryRepository = productCategoryRepository; this._productRepository = productRepository; //this._aclRepository = aclRepository; this._storeMappingRepository = storeMappingRepository; //this._workContext = workContext; this._storeContext = storeContext; //this._eventPublisher = eventPublisher; this._storeMappingService = storeMappingService; //this._aclService = aclService; this._settingDomainService = settingDomainService; }
/// <summary> /// Get category breadcrumb /// </summary> /// <param name="category">Category</param> /// <param name="allCategories">All categories</param> /// <param name="aclService">ACL service</param> /// <param name="storeMappingService">Store mapping service</param> /// <param name="showHidden">A value indicating whether to load hidden records</param> /// <returns>Category breadcrumb </returns> public static IList <Category> GetCategoryBreadCrumb(this Category category, IList <Category> allCategories, //IAclService aclService, StoreMappingDomainService storeMappingService, bool showHidden = false) { if (category == null) { throw new ArgumentNullException("category"); } var result = new List <Category>(); //used to prevent circular references var alreadyProcessedCategoryIds = new List <int>(); while (category != null && //not null !category.Deleted && //not deleted (showHidden || category.Published) && //published //(showHidden || aclService.Authorize(category)) && //ACL (showHidden || storeMappingService.Authorize(category)) && //Store mapping !alreadyProcessedCategoryIds.Contains(category.Id)) //prevent circular references { result.Add(category); alreadyProcessedCategoryIds.Add(category.Id); category = (from c in allCategories where c.Id == category.ParentCategoryId select c).FirstOrDefault(); } result.Reverse(); return(result); }
/// <summary> /// Ctor /// </summary> /// <param name="cacheManager">Cache manager</param> /// <param name="checkoutAttributeRepository">Checkout attribute repository</param> /// <param name="checkoutAttributeValueRepository">Checkout attribute value repository</param> /// <param name="storeMappingService">Store mapping service</param> /// <param name="eventPublisher">Event published</param> public CheckoutAttributeDomainService(ICacheManager cacheManager, ICheckoutAttributeRepository checkoutAttributeRepository, ICheckoutAttributeValueRepository checkoutAttributeValueRepository, StoreMappingDomainService storeMappingService //IEventPublisher eventPublisher ) { this._cacheManager = cacheManager; this._checkoutAttributeRepository = checkoutAttributeRepository; this._checkoutAttributeValueRepository = checkoutAttributeValueRepository; this._storeMappingService = storeMappingService; //this._eventPublisher = eventPublisher; }
//private readonly LocalizationSettings _localizationSettings; //private readonly IEventPublisher _eventPublisher; #endregion #region Ctor /// <summary> /// Ctor /// </summary> /// <param name="cacheManager">Cache manager</param> /// <param name="languageRepository">Language repository</param> /// <param name="storeMappingService">Store mapping service</param> /// <param name="settingService">Setting service</param> /// <param name="localizationSettings">Localization settings</param> /// <param name="eventPublisher">Event published</param> public LanguageDomainService(ICacheManager cacheManager , ILanguageRepository languageRepository , StoreMappingDomainService storeMappingService , SettingDomainService settingService , IStoreContext storeContext //,LocalizationSettings localizationSettings //IEventPublisher eventPublisher ) { this._cacheManager = cacheManager; this._languageRepository = languageRepository; this._storeMappingService = storeMappingService; this._settingService = settingService; _storeContext = storeContext; //this._localizationSettings = localizationSettings; //this._eventPublisher = eventPublisher; }
/// <summary> /// Ctor /// </summary> /// <param name="cacheManager">Cache manager</param> /// <param name="currencyRepository">Currency repository</param> /// <param name="storeMappingService">Store mapping service</param> /// <param name="currencySettings">Currency settings</param> /// <param name="pluginFinder">Plugin finder</param> /// <param name="eventPublisher">Event published</param> public CurrencyDomainService(ICacheManager cacheManager, ICurrencyRepository currencyRepository, StoreMappingDomainService storeMappingService, IStoreContext storeContext, SettingDomainService settingDomainService //CurrencySettings currencySettings //IPluginFinder pluginFinder, //IEventPublisher eventPublisher ) { this._cacheManager = cacheManager; this._currencyRepository = currencyRepository; this._storeMappingService = storeMappingService; this._storeContext = storeContext; _settingDomainService = settingDomainService; //this._currencySettings = currencySettings; //this._pluginFinder = pluginFinder; //this._eventPublisher = eventPublisher; }