コード例 #1
0
        protected CachingCrmEntitySecurityProvider(ICacheSupportingCrmEntitySecurityProvider underlyingProvider, ICrmEntitySecurityCacheInfoFactory cacheInfoFactory)
        {
            if (underlyingProvider == null)
            {
                throw new ArgumentNullException("underlyingProvider");
            }

            if (cacheInfoFactory == null)
            {
                throw new ArgumentNullException("cacheInfoFactory");
            }

            UnderlyingProvider = underlyingProvider;
            CacheInfoFactory   = cacheInfoFactory;
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
 public ApplicationCachingCrmEntitySecurityProvider(
     ICacheSupportingCrmEntitySecurityProvider underlyingProvider,
     ICrmEntitySecurityCacheInfoFactory cacheInfoFactory)
     : base(underlyingProvider, cacheInfoFactory)
 {
 }