Beispiel #1
0
 public SitecoreRepository(IDatabaseProvider dbProvider,
                           ISitecoreServiceProvider sitecoreServiceProvider,
                           IProviderSearchContextProvider searchContextProvider,
                           ILogger logger)
 {
     _dbProvider = dbProvider;
     _sitecoreServiceProvider = sitecoreServiceProvider;
     _searchContextProvider   = searchContextProvider;
     _logger = logger;
 }
Beispiel #2
0
        public SitecoreRepository(IDatabaseProvider dbProvider,
                                  ISitecoreServiceProvider sitecoreServiceProvider,
                                  IProviderSearchContextProvider searchContextProvider,
                                  ILogger logger)
        {
            _dbProvider = dbProvider;
            _sitecoreServiceProvider = sitecoreServiceProvider;
            _searchContextProvider   = searchContextProvider;
            _logger = logger;

            var classInfo = _sitecoreServiceProvider.GetSitecoreService().GlassContext[typeof(T)];

            _parentProperty = classInfo.Properties.OfType <ParentConfiguration>().FirstOrDefault();

            _pathProperty = classInfo.Properties.OfType <SitecoreInfoConfiguration>().FirstOrDefault(p => p.Type == SitecoreInfoType.FullPath || p.Type == SitecoreInfoType.Path);
            _nameProperty = classInfo.Properties.OfType <SitecoreInfoConfiguration>().FirstOrDefault(p => p.Type == SitecoreInfoType.Name);
        }