File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change 11# Redis.EasyConnectMultiServers
2+ ![ Nuget] ( https://img.shields.io/nuget/dt/Redis.EasyConnectMultiServers )
3+ ![ GitHub Workflow Status] ( https://img.shields.io/github/actions/workflow/status/wodsonluiz/Redis.EasyConnectMultiServers/dotnet.yml )
4+ ![ Nuget] ( https://img.shields.io/nuget/v/Redis.EasyConnectMultiServers )
5+
26Biblioteca para facilitar e realizar todas as operações de CRUD em multiplos servidores do Redis.
7+
8+ ### Setting
9+
10+ ``` csharp
11+ var configurations = new []
12+ {
13+ new RedisConfiguration
14+ {
15+ AbortOnConnectFail = true ,
16+ KeyPrefix = " MyPrefix__" ,
17+ Hosts = new [] { new RedisHost { Host = " localhost" , Port = 6379 } },
18+ AllowAdmin = true ,
19+ ConnectTimeout = 5000 ,
20+ Database = 0 ,
21+ PoolSize = 5 ,
22+ IsDefault = true
23+ },
24+ new RedisConfiguration
25+ {
26+ AbortOnConnectFail = true ,
27+ KeyPrefix = " MyPrefix__" ,
28+ Hosts = new [] { new RedisHost { Host = " localhost" , Port = 6389 } },
29+ AllowAdmin = true ,
30+ ConnectTimeout = 5000 ,
31+ Database = 0 ,
32+ PoolSize = 2 ,
33+ Name = " Secndary Instance"
34+ }
35+ };
36+
37+ services .AddRedisProviderMultiServers <SystemTextJsonSerializer >(configurations );
38+ ```
39+
40+ ### Example using
41+
42+ ``` csharp
43+ public class WeatherForecastController : ControllerBase
44+ {
45+ private readonly IRedisProviderMultiServers _redisProviderMultiServers ;
46+
47+ public WeatherForecastController (IRedisProviderMultiServers redisProviderMultiServers )
48+ {
49+ _redisProviderMultiServers = redisProviderMultiServers ;
50+ }
51+ }
52+
53+ ```
54+
55+ #### Add example
56+
57+ ``` csharp
58+ await _redisProviderMultiServers .AddMultiAsync (Guid .NewGuid ().ToString (), " value" );
59+ ```
60+
61+ #### Get example
62+ ``` csharp
63+ await _redisProviderMultiServers .GetMultiAsync <string >(guid .ToString ());
64+ ```
You can’t perform that action at this time.
0 commit comments