Esempio n. 1
0
        protected virtual IDictionary<string, string> GetCommonFacetAliasByGroupKindMappings()
        {
            return _cacheManager.Get(ALL_FORUM_COMMONFACET_ALIAS_BY_KIND_KEY, () =>
            {
                var result = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);

                var groupKinds = new FacetGroupKind[]
                {
                    FacetGroupKind.Forum,
                    FacetGroupKind.Customer,
                    FacetGroupKind.Date
                };

                foreach (var language in _languageService.GetAllLanguages())
                {
                    foreach (var groupKind in groupKinds)
                    {
                        var key = FacetUtility.GetFacetAliasSettingKey(groupKind, language.Id, "Forum");
                        var value = _settingService.GetSettingByKey<string>(key);
                        if (value.HasValue())
                        {
                            result.Add(key, value);
                        }
                    }
                }

                return result;
            });
        }
        protected virtual IDictionary <string, string> GetCommonFacetAliasByGroupKindMappings()
        {
            return(_cacheManager.Get(ALL_COMMONFACET_ALIAS_BY_KIND_KEY, () =>
            {
                var result = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);

                var groupKinds = new FacetGroupKind[]
                {
                    FacetGroupKind.Category,
                    FacetGroupKind.Brand,
                    FacetGroupKind.Price,
                    FacetGroupKind.Rating,
                    FacetGroupKind.DeliveryTime,
                    FacetGroupKind.Availability,
                    FacetGroupKind.NewArrivals
                };

                foreach (var language in _languageService.GetAllLanguages())
                {
                    foreach (var groupKind in groupKinds)
                    {
                        var key = FacetUtility.GetFacetAliasSettingKey(groupKind, language.Id);
                        var value = _settingService.GetSettingByKey <string>(key);
                        if (value.HasValue())
                        {
                            result.Add(key, value);
                        }
                    }
                }

                return result;
            }));
        }
Esempio n. 3
0
        public string GetCommonFacetAliasByGroupKind(FacetGroupKind kind, int languageId)
        {
            var mappings = GetCommonFacetAliasByGroupKindMappings();

            return mappings.Get(FacetUtility.GetFacetAliasSettingKey(kind, languageId, "Forum"));
        }