Browse Source

Merge pull request #12074 from abpframework/Doc-Dist-Lock

Doc dist lock
pull/12077/head
Halil İbrahim Kalkan 4 years ago
committed by GitHub
parent
commit
4385d8a384
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      docs/en/Distributed-Locking.md

30
docs/en/Distributed-Locking.md

@ -27,21 +27,25 @@ using Medallion.Threading.Redis;
namespace AbpDemo
{
public class MyModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
{
var connection = ConnectionMultiplexer
[DependsOn(
typeof(AbpDistributedLockingModule)
//If you have the other dependencies, you should do here
)]
public class MyModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
{
var connection = ConnectionMultiplexer
.Connect(configuration["Redis:Configuration"]);
return new
return new
RedisDistributedSynchronizationProvider(connection.GetDatabase());
});
}
}
});
}
}
}
````

Loading…
Cancel
Save