Skip to content

Commit bf9de87

Browse files
authored
Merge pull request #6 from wodsonluiz/update/readme
update file
2 parents 528ed56 + a1a0036 commit bf9de87

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,64 @@
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+
26
Biblioteca 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+
```

0 commit comments

Comments
 (0)