当前位置: 首页>>代码示例>>C#>>正文


C# IRedisClientsManager.ThrowIfNull方法代码示例

本文整理汇总了C#中IRedisClientsManager.ThrowIfNull方法的典型用法代码示例。如果您正苦于以下问题:C# IRedisClientsManager.ThrowIfNull方法的具体用法?C# IRedisClientsManager.ThrowIfNull怎么用?C# IRedisClientsManager.ThrowIfNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IRedisClientsManager的用法示例。


在下文中一共展示了IRedisClientsManager.ThrowIfNull方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RedisCache

        public RedisCache(string regionName, IDictionary<string, string> properties, RedisCacheElement element, IRedisClientsManager clientManager)
        {
            this.serializer = new ObjectSerializer();
            this.clientManager = clientManager.ThrowIfNull("clientManager");
            RegionName = regionName.ThrowIfNull("regionName");

            expirySeconds = element != null
                ? (int)element.Expiration.TotalSeconds
                : PropertiesHelper.GetInt32(NHibernate.Cfg.Environment.CacheDefaultExpiration, properties, DefaultExpiry);

            log.DebugFormat("using expiration : {0} seconds", expirySeconds);

            var regionPrefix = PropertiesHelper.GetString(NHibernate.Cfg.Environment.CacheRegionPrefix, properties, null);
            log.DebugFormat("using region prefix : {0}", regionPrefix);

            CacheNamePrefix = element != null ? element.CachePrefix : string.Empty;

            var namespacePrefix = CacheNamePrefix + RegionName;
            if (!String.IsNullOrWhiteSpace(regionPrefix))
            {
                namespacePrefix = regionPrefix + ":" + namespacePrefix;
            }

            CacheNamespace = new RedisNamespace(namespacePrefix);
            SyncGeneration();
        }
开发者ID:cerasumat,项目名称:CacheRedis,代码行数:26,代码来源:RedisCache.cs

示例2: SetClientManager

 public static void SetClientManager(IRedisClientsManager clientManager)
 {
     if (clientManagerStatic != null)
     {
         throw new InvalidOperationException("Redis Client Manager只能配置一次.");
     }
     clientManagerStatic = clientManager.ThrowIfNull();
 }
开发者ID:cerasumat,项目名称:CacheRedis,代码行数:8,代码来源:RedisCacheProvider.cs

示例3: SetClientManager

        public static void SetClientManager(IRedisClientsManager clientManager)
        {           
            if (clientManagerStatic != null)
            {
                throw new InvalidOperationException("The client manager can only be configured once.");
            }

            clientManagerStatic = clientManager.ThrowIfNull();
        }
开发者ID:kowalgta,项目名称:NHibernate.Caches.Redis,代码行数:9,代码来源:RedisCacheProvider.cs

示例4: ExecOnceOnly

        public ExecOnceOnly(IRedisClientsManager redisManager, string hashKey, string correlationId)
        {
            redisManager.ThrowIfNull("redisManager");
            hashKey.ThrowIfNull("hashKey");

            this.hashKey = hashKey;
            this.correlationId = correlationId;

            if (correlationId != null)
            {
                redis = redisManager.GetClient();
                var exists = !redis.SetEntryInHashIfNotExists(hashKey, correlationId, Flag);
                if (exists)
                    throw HttpError.Conflict("Request {0} has already been processed".Fmt(correlationId));
            }
        }
开发者ID:nstjelja,项目名称:ServiceStack,代码行数:16,代码来源:ExecOnlyOnce.cs

示例5: RateLimitFeature

        public RateLimitFeature(IRedisClientsManager redisClientsManager)
        {
            redisClientsManager.ThrowIfNull(nameof(redisClientsManager));

            this.redisClientsManager = redisClientsManager;
        }
开发者ID:yonglehou,项目名称:servicestack-ratelimit-redis,代码行数:6,代码来源:RateLimitFeature.cs


注:本文中的IRedisClientsManager.ThrowIfNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。