public void GetSubsitesInfo_ReturnList()
        {
            ISubsiteService service = UnitOfWork.GetService <ISubsiteService>();
            IServiceQueryResultList <SubsiteBriefData> result = service.GetSubsites();
            List <SubsiteBriefData> list = result.DataList.ToList();

            if (list != null)
            {
            }
        }
示例#2
0
        internal List <TDto> GetSubsites <TDto>(IDataConverter <SubsiteBriefData, TDto> converter, bool isPublished = false)
            where TDto : class
        {
            ISubsiteService service = UnitOfWork.GetService <ISubsiteService>();
            var             query   = service.GetSubsites(isPublished);

            if (query.HasResult)
            {
                return(query.DataToDtoList(converter).ToList());
            }

            return(null);
        }
示例#3
0
        public void Initilize()
        {
            IGeneralService service = ServiceLocator.Current.GetInstance <IGeneralService>();

            StaticMetadataList = service.GetMetadata();
            HeaderMenus        = service.GetHeaderMenus().ToList();
            FooterMenus        = service.GetFooterMenus().ToList();
            IEnumerable <LanguageDto> availableLanguages = service.GetLanguages().ToList();

            foreach (LanguageDto language in availableLanguages)
            {
                LanguageDic.Add(language.Id, language);
                LanguageDicByCulture.Add(language.Culture, language);
            }

            DefaultLanguage = LanguageDic[DefaultLanguageId];

            ISubsiteService subsiteService         = ServiceLocator.Current.GetInstance <ISubsiteService>();
            IEnumerable <SubsiteBriefDto> subsites = subsiteService.GetSubsites(true);

            foreach (SubsiteBriefDto item in subsites)
            {
                // Set Subsite redirection dictionary
                string key = string.Format("/{0}", item.Slug.ToLower());
                string value;
                if (WebContext.Current.IsMultiLanguageSupported)
                {
                    value = string.Format("/{0}/{1}", item.Culture, item.Slug);
                }
                else
                {
                    value = string.Format("/{0}", item.Slug);
                }
                SubsiteRedirectDic.Add(key, value);
            }

            InitAdSlotSize();

            InitRecipeKeywordsAndCategories();
        }