Exemplo n.º 1
0
        public static SeoVm GetSeo(SearchVm result)
        {
            SeoVm seoVm = new SeoVm()
            {
                PageType     = result.PageType,
                CanonicalUrl = MslcUrlBuilder.SearchUrl(result.Criteria, result.PageType.ToSearchType())
            };
            PageType pageType = seoVm.PageType;

            if (pageType <= PageType.ShcByType)
            {
                if (pageType == PageType.Index)
                {
                    seoVm.Title        = Title.Index;
                    seoVm.Header       = Header.Index;
                    seoVm.Description  = Description.Index;
                    seoVm.CanonicalUrl = MslcUrlBuilder.BaseUrl;
                }
                else if (pageType == PageType.ShcByType)
                {
                    seoVm.Title       = Title.SearchSHC;
                    seoVm.Description = Description.SearchSHC;
                    seoVm.Header      = Header.SearchSHC;
                    seoVm.MarketCopy  = MarketCopy.SearchSHC;
                }
            }
            else if (pageType == PageType.AacByType)
            {
                seoVm.Title       = Title.SearchAAC;
                seoVm.Description = Description.SearchAAC;
                seoVm.Header      = Header.SearchAAC;
                seoVm.MarketCopy  = MarketCopy.SearchAAC;
            }
            else if (pageType == PageType.AahByType)
            {
                seoVm.Title       = Title.SearchAAH;
                seoVm.Description = Description.SearchAAH;
                seoVm.Header      = Header.SearchAAH;
                seoVm.MarketCopy  = MarketCopy.SearchAAH;
            }
            else if (pageType == PageType.ServiceProvidersByType)
            {
                seoVm.Title       = Title.SearchServices;
                seoVm.Description = Description.SearchServices;
                seoVm.Header      = Header.SearchServices;
                seoVm.MarketCopy  = MarketCopy.SearchServices;
            }
            seoVm.Title       = seoVm.Title.Replace(result);
            seoVm.Description = seoVm.Description.Replace(result);
            seoVm.Header      = seoVm.Header.Replace(result);
            return(seoVm);
        }