From c7d0a2ae1b5288074ba57ec545cbb36b46d08a62 Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 18:04:42 -0300 Subject: [PATCH 1/9] Update publish.yml --- .github/workflows/publish.yml | 44 ----------------------------------- 1 file changed, 44 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1f7e818..5ffef4b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -48,48 +48,4 @@ jobs: - name: Test run: dotnet test --no-build --verbosity normal - publish: - - runs-on: ubuntu-latest - needs: test - - steps: - - uses: actions/checkout@v2 - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 6.0.x - - name: publish on version change - id: publish_nuget - uses: rohith/publish-nuget@v2 - with: - # Filepath of the project to be packaged, relative to root of repository - PROJECT_FILE_PATH: DevelopmentFast.Cache.Redis/DevelopmentFast.Cache.Redis.csproj - - # NuGet package id, used for version detection & defaults to project name - PACKAGE_NAME: DevelopmentFast.CacheRedis - - # Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH - # VERSION_FILE_PATH: Directory.Build.props - - # Regex pattern to extract version info in a capturing group - VERSION_REGEX: ^\s*(.*)<\/Version>\s*$ - - # Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX - # VERSION_STATIC: 1.0.0 - - # Flag to toggle git tagging, enabled by default - # TAG_COMMIT: true - - # Format of the git tag, [*] gets replaced with actual version - # TAG_FORMAT: v* - - # API key to authenticate with NuGet server - NUGET_KEY: ${{secrets.NUGET_API_KEY}} - - # NuGet server uri hosting the packages, defaults to https://api.nuget.org - NUGET_SOURCE: https://api.nuget.org - - # Flag to toggle pushing symbols along with nuget package to the server, disabled by default - # INCLUDE_SYMBOLS: false From 910981e53b7c90dded5421769e4415b69ccf53db Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 18:19:57 -0300 Subject: [PATCH 2/9] Update publish.yml --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5ffef4b..7f648f0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -40,7 +40,7 @@ jobs: redis-version: 6 - name: Install redis cli # so we can test the server - run: sudo apt-get install -y redis-tools + run: sudo apt-get update -y redis-tools - name: Verify that redis is up run: redis-cli ping From 23aebe1f8b1e5795b6949dc532f5a348a3329e4a Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 18:24:46 -0300 Subject: [PATCH 3/9] Update publish.yml --- .github/workflows/publish.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7f648f0..295eb9d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -38,13 +38,7 @@ 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 update -y redis-tools - - - name: Verify that redis is up - run: redis-cli ping - + - name: Test run: dotnet test --no-build --verbosity normal From 9a66a656cd32a49c090519a010284ef5092fef1c Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 18:31:34 -0300 Subject: [PATCH 4/9] Update publish.yml --- .github/workflows/publish.yml | 48 +++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 295eb9d..aca76ed 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -40,6 +40,50 @@ jobs: redis-version: 6 - name: Test - run: dotnet test --no-build --verbosity normal - + run: dotnet test --no-build --verbosity normal + + publish: + + runs-on: ubuntu-latest + needs: test + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 6.0.x + - name: publish on version change + id: publish_nuget + uses: rohith/publish-nuget@v2 + with: + # Filepath of the project to be packaged, relative to root of repository + PROJECT_FILE_PATH: DevelopmentFast.Cache.Redis/DevelopmentFast.Cache.Redis.csproj + + # NuGet package id, used for version detection & defaults to project name + PACKAGE_NAME: DevelopmentFast.CacheRedis + + # Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH + # VERSION_FILE_PATH: Directory.Build.props + + # Regex pattern to extract version info in a capturing group + VERSION_REGEX: ^\s*(.*)<\/Version>\s*$ + + # Useful with external providers like Nerdbank.GitVersioning, ignores VERSION_FILE_PATH & VERSION_REGEX + # VERSION_STATIC: 1.0.0 + + # Flag to toggle git tagging, enabled by default + # TAG_COMMIT: true + + # Format of the git tag, [*] gets replaced with actual version + # TAG_FORMAT: v* + + # API key to authenticate with NuGet server + NUGET_KEY: ${{secrets.NUGET_API_KEY}} + + # NuGet server uri hosting the packages, defaults to https://api.nuget.org + NUGET_SOURCE: https://api.nuget.org + + # Flag to toggle pushing symbols along with nuget package to the server, disabled by default + # INCLUDE_SYMBOLS: false From b3f8ddcf20b2090cad390af0f6446e0641ed78d6 Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 19:49:29 -0300 Subject: [PATCH 5/9] Update DevelopmentFast.Cache.Redis.csproj --- DevelopmentFast.Cache.Redis/DevelopmentFast.Cache.Redis.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From ab09bde94844b25cb0cc1d51c1f79e288f48c817 Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 20:39:22 -0300 Subject: [PATCH 6/9] Update README.md --- README.md | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0c4f55d..2b3f4a7 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Uma biblioteca para ajudar no rápido desenvolvimento para aplicar camada de Cac -### 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,27 +82,27 @@ 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"); From f0b473656b84c785b9eb8972cd676f39a661ef43 Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 21:58:27 -0300 Subject: [PATCH 7/9] Update README.md --- README.md | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2b3f4a7..a84058b 100644 --- a/README.md +++ b/README.md @@ -82,14 +82,14 @@ public StudentController(IBaseRedisRepositoryDF baseRedisRepositoryDF) } ``` -### Create or Update Asynchronous +### Create or Update asynchronous ```csharp var student = new Student("name_student"); await _baseRedisRepositoryDF.CreateOrUpdateAsync("key_example", student , TimeSpan.FromMinutes(1)); ``` -### Create or Update Synchronous +### Create or Update synchronous ```csharp var student = new Student("name_student"); @@ -102,8 +102,33 @@ _baseRedisRepositoryDF.CreateOrUpdate("key_example", student , TimeSpan var student = await _baseRedisRepositoryDF.GetAsync("key_example"); ``` -### Get Synchronous +### 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"); +``` From 1b9443d55e3c1cf99fb1c5b3b5395885be871612 Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 21:59:55 -0300 Subject: [PATCH 8/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a84058b..8ed0eea 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ var student = _baseRedisRepositoryDF.Get("key_example"); _baseRedisRepositoryDF.Remove("key_example"); ``` -### Remove Asynchronous +### Remove asynchronous ```csharp _baseRedisRepositoryDF.RemoveAsync("key_example"); From f56fbcf751b95cae205c395dbb15b278146ecf5d Mon Sep 17 00:00:00 2001 From: Abner Matheus Date: Tue, 25 Jan 2022 22:02:57 -0300 Subject: [PATCH 9/9] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8ed0eea..2072fd0 100644 --- a/README.md +++ b/README.md @@ -12,26 +12,26 @@ 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 ? ### Where is it available ?