예제 #1
0
        public override IConfigurationLoader[] GetGlassLoaders(Glass.Mapper.Context context)
        {
            var loaders1 = GlassMapperScCustom.GlassLoaders();
            var loaders2 = base.GetGlassLoaders(context);

            return(loaders1.Concat(loaders2).ToArray());
        }
예제 #2
0
        public GlassModelCounter(Glass.Mapper.Context context, string identifier, int threshold)
        {
            _log        = context.DependencyResolver.GetLog();
            _identifier = identifier;
            _threshold  = threshold;
            _enabled    = context.Config.Debug.Enabled;

            RequestCount = -1;
            CacheCount   = -1;

            if (_enabled)
            {
                _requestedCountBefore = ConstructionMonitorTask.GetCounter(ConstructionMonitorTask.CalledKey);
                _cacheMissCountBefore = ConstructionMonitorTask.GetCounter(ConstructionMonitorTask.CacheMissKey);
            }
        }
예제 #3
0
        public GlassModelCounter(Glass.Mapper.Context context, string identifier, int threshold)
        {
            _log        = context.DependencyResolver.GetLog();
            _identifier = identifier;
            _threshold  = threshold;
            _enabled    = context.Config.Debug.Enabled;
            _counter    = context.DependencyResolver.GetModelCounter();

            RequestCount = -1;
            CacheCount   = -1;

            if (_enabled)
            {
                _requestedCountBefore = _counter.ModelsRequested;
                _cacheCount           = _counter.CachedModels;
            }
        }
예제 #4
0
        public static void LoadConfigurationMaps(IDependencyResolver resolver, Glass.Mapper.Context context)
        {
            var dependencyResolver = resolver as DependencyResolver;

            if (dependencyResolver == null)
            {
                return;
            }

            if (dependencyResolver.ConfigurationMapFactory is ConfigurationMapConfigFactory)
            {
                GlassMapperScCustom.AddMaps(dependencyResolver.ConfigurationMapFactory);
            }

            IConfigurationMap configurationMap = new ConfigurationMap(dependencyResolver);
            SitecoreFluentConfigurationLoader configurationLoader = configurationMap.GetConfigurationLoader <SitecoreFluentConfigurationLoader>();

            context.Load(configurationLoader);
        }
예제 #5
0
 public DefaultSitecoreService(Database database, Glass.Mapper.Context context)
     : base(database, context)
 {
 }
예제 #6
0
 public DefaultSitecoreService(string databaseName, Glass.Mapper.Context context)
     : base(databaseName, context)
 {
 }