diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1f7e818..aca76ed 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -38,16 +38,11 @@ jobs: uses: supercharge/redis-github-action@1.2.0 with: redis-version: 6 - - - name: Install redis cli # so we can test the server - run: sudo apt-get install -y redis-tools - - - name: Verify that redis is up - run: redis-cli ping - + - name: Test - run: dotnet test --no-build --verbosity normal - + run: dotnet test --no-build --verbosity normal + + publish: runs-on: ubuntu-latest @@ -92,4 +87,3 @@ jobs: # Flag to toggle pushing symbols along with nuget package to the server, disabled by default # INCLUDE_SYMBOLS: false - diff --git a/DevelopmentFast.Cache.Redis/DevelopmentFast.Cache.Redis.csproj b/DevelopmentFast.Cache.Redis/DevelopmentFast.Cache.Redis.csproj index 5599fb3..b786643 100644 --- a/DevelopmentFast.Cache.Redis/DevelopmentFast.Cache.Redis.csproj +++ b/DevelopmentFast.Cache.Redis/DevelopmentFast.Cache.Redis.csproj @@ -8,7 +8,7 @@ A library to aid in rapid development to apply Cache layer using Redis, using Repository Pattern Generic. Logo.png git. - 1.0.0 + 1.0.1 DevelopmentFast.CacheRedis 1.0.1 diff --git a/README.md b/README.md index 0c4f55d..2072fd0 100644 --- a/README.md +++ b/README.md @@ -12,46 +12,66 @@ Uma biblioteca para ajudar no rápido desenvolvimento para aplicar camada de Cac | ------- | ----- | ----- | | `DevelopmentFast.Cache` | [![NuGet](https://img.shields.io/nuget/v/DevelopmentFast.CacheRedis.svg)](https://www.nuget.org/packages/DevelopmentFast.CacheRedis) | [![Nuget](https://img.shields.io/nuget/dt/DevelopmentFast.CacheRedis.svg)](https://www.nuget.org/packages/DevelopmentFast.CacheRedis) | -### O que é ? +### What is it ? -### Por que eu criei ? +### Why i created ? -### Onde está disponível ? +### Where is it available ? -### Como utilizar ? +### How to use ? -### Injeções de dependência e conexão +### Dependency and connection injections ```csharp builder.Services.AddSingleton(); builder.Services.AddStackExchangeRedisCache(x => x.Configuration = "localhost:6379"); ``` +### Or +```csharp + +//Scoped + services.AddScopedRedisCacheDF(x => + { + x.Configuration = "localhost:6379"; + }); + +//Transient + services.AddTransientRedisCacheDF(x => + { + x.Configuration = "localhost:6379"; + }); + +//Singleton + services.AddSingletonRedisCacheDF(x => + { + x.Configuration = "localhost:6379"; + }); +``` + -### Construtor +### Constructor ```csharp private readonly IBaseRedisRepositoryDF _baseRedisRepositoryDF; @@ -62,28 +82,53 @@ public StudentController(IBaseRedisRepositoryDF baseRedisRepositoryDF) } ``` -### Criar ou Atualizar assíncrono +### Create or Update asynchronous ```csharp var student = new Student("name_student"); await _baseRedisRepositoryDF.CreateOrUpdateAsync("key_example", student , TimeSpan.FromMinutes(1)); ``` -### Criar ou Atualizar síncrono +### Create or Update synchronous ```csharp var student = new Student("name_student"); _baseRedisRepositoryDF.CreateOrUpdate("key_example", student , TimeSpan.FromMinutes(1)); ``` -### Buscar assíncrono +### Get asynchronous ```csharp var student = await _baseRedisRepositoryDF.GetAsync("key_example"); ``` -### Buscar síncrono +### Get synchronous ```csharp var student = _baseRedisRepositoryDF.Get("key_example"); ``` + +### Remove synchronous + +```csharp +_baseRedisRepositoryDF.Remove("key_example"); +``` + +### Remove asynchronous + +```csharp +_baseRedisRepositoryDF.RemoveAsync("key_example"); +``` + + +### Refresh synchronous + +```csharp +_baseRedisRepositoryDF.Refresh("key_example"); +``` + +### Refresh asynchronous + +```csharp +_baseRedisRepositoryDF.RefreshAsync("key_example"); +```