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