protected CachingCrmEntitySecurityProvider(ICacheSupportingCrmEntitySecurityProvider underlyingProvider, ICrmEntitySecurityCacheInfoFactory cacheInfoFactory) { if (underlyingProvider == null) { throw new ArgumentNullException("underlyingProvider"); } if (cacheInfoFactory == null) { throw new ArgumentNullException("cacheInfoFactory"); } UnderlyingProvider = underlyingProvider; CacheInfoFactory = cacheInfoFactory; }
public override void Initialize(string name, NameValueCollection config) { base.Initialize(name, config); var portalName = config["portalName"]; var contentMapProvider = AdxstudioCrmConfigurationManager.CreateContentMapProvider(portalName); _underlyingProvider = contentMapProvider != null ? new ContentMapUncachedProvider(contentMapProvider) : new UncachedProvider(portalName); var cacheInfoFactory = new CrmEntitySecurityCacheInfoFactory(GetType().FullName); bool cachingEnabled; if (!bool.TryParse(config["cachingEnabled"], out cachingEnabled)) { cachingEnabled = true; } if (cachingEnabled) { _underlyingProvider = new ApplicationCachingCrmEntitySecurityProvider(_underlyingProvider, cacheInfoFactory); } bool requestCachingEnabled; if (!bool.TryParse(config["requestCachingEnabled"], out requestCachingEnabled)) { requestCachingEnabled = true; } if (requestCachingEnabled && HttpContext.Current != null) { _underlyingProvider = new RequestCachingCrmEntitySecurityProvider(_underlyingProvider, cacheInfoFactory); } }
public ApplicationCachingCrmEntitySecurityProvider( ICacheSupportingCrmEntitySecurityProvider underlyingProvider, ICrmEntitySecurityCacheInfoFactory cacheInfoFactory) : base(underlyingProvider, cacheInfoFactory) { }