Beispiel #1
0
 public DynamicRouteProvider(ISeoMetaService seoMetaService, ICategoryService categoryService, IRouteTemplateParser routeTemplateParser, IContentPageService contentPageService)
 {
     _seoMetaService      = seoMetaService;
     _categoryService     = categoryService;
     _routeTemplateParser = routeTemplateParser;
     _contentPageService  = contentPageService;
 }
Beispiel #2
0
        public static void UpdateSeoMetaForEntity <T>(this ISeoMetaService seoMetaService, T entity, SeoMetaModel seoMetaModel) where T : FoundationEntity
        {
            var seoMeta = seoMetaService.FirstOrDefault(
                x => x.EntityId == entity.Id && x.EntityName == typeof(T).Name);

            if (seoMeta != null)
            {
                seoMeta.PageTitle       = seoMetaModel.PageTitle;
                seoMeta.MetaKeywords    = seoMetaModel.MetaKeywords;
                seoMeta.MetaDescription = seoMetaModel.MetaDescription;
                if (!seoMetaModel.Slug.IsNullEmptyOrWhiteSpace())
                {
                    //check if slug is safe to use, modify if required
                    var     slug         = seoMetaModel.Slug;
                    SeoMeta savedSeoMeta = null;
                    var     index        = 1;
                    while ((savedSeoMeta = seoMetaService.FirstOrDefault(x => x.EntityName == typeof(T).Name && x.Slug == slug && x.Id != seoMeta.Id)) != null)
                    {
                        slug = savedSeoMeta.Slug + (index++);
                    }
                    seoMeta.Slug = slug;
                }
                seoMetaService.Update(seoMeta);
            }
        }
Beispiel #3
0
 public ContentPagesController(IContentPageService contentPageService, IModelMapper modelMapper, IDataSerializer dataSerializer, ISeoMetaService seoMetaService)
 {
     _contentPageService = contentPageService;
     _modelMapper        = modelMapper;
     _dataSerializer     = dataSerializer;
     _seoMetaService     = seoMetaService;
 }
 public SeoEntityConsumer(ISeoMetaService seoMetaService)
 {
     _seoMetaService = seoMetaService;
 }