本文整理汇总了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();
}
示例2: SetClientManager
public static void SetClientManager(IRedisClientsManager clientManager)
{
if (clientManagerStatic != null)
{
throw new InvalidOperationException("Redis Client Manager只能配置一次.");
}
clientManagerStatic = clientManager.ThrowIfNull();
}
示例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();
}
示例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));
}
}
示例5: RateLimitFeature
public RateLimitFeature(IRedisClientsManager redisClientsManager)
{
redisClientsManager.ThrowIfNull(nameof(redisClientsManager));
this.redisClientsManager = redisClientsManager;
}