コード例 #1
0
 /// <summary>
 /// 使用redis分布式锁
 /// </summary>
 /// <param name="containerManager"></param>
 /// <returns></returns>
 public static ContainerManager UseRedisLock(this ContainerManager containerManager)
 {
     return(containerManager.AddScoped <ILockOptionProvider, DefaultLockOptionProvider>()
            .AddScoped <ILock, DefaultRedisLock>()
            );
 }
コード例 #2
0
 /// <summary>
 /// 使用redis
 /// </summary>
 /// <param name="containerManager"></param>
 /// <returns></returns>
 public static ContainerManager UseRedis(this ContainerManager containerManager)
 {
     return(containerManager.AddScoped <IRedisBinarySerializer, RedisJsonBinarySerializer>()
            .AddScoped <IRedisDatabaseProvider, StackExchangeRedisProvider>()
            );
 }