Rystem.RepositoryFramework.Cache 0.9.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rystem.RepositoryFramework.Cache --version 0.9.10
                    
NuGet\Install-Package Rystem.RepositoryFramework.Cache -Version 0.9.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rystem.RepositoryFramework.Cache" Version="0.9.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rystem.RepositoryFramework.Cache" Version="0.9.10" />
                    
Directory.Packages.props
<PackageReference Include="Rystem.RepositoryFramework.Cache" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rystem.RepositoryFramework.Cache --version 0.9.10
                    
#r "nuget: Rystem.RepositoryFramework.Cache, 0.9.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rystem.RepositoryFramework.Cache@0.9.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rystem.RepositoryFramework.Cache&version=0.9.10
                    
Install as a Cake Addin
#tool nuget:?package=Rystem.RepositoryFramework.Cache&version=0.9.10
                    
Install as a Cake Tool

Cache

Examples

You can add a repository (with default blob integration for instance) and after attack an in memory cache for all methods. The RefreshTime is a property that adds an Expiration date to the cached value, in the example below you can see that after 20 seconds the in memory cache requests again to the repository pattern a new value for each key. The Methods is a flag that allows to setup what operations have to be cached.

Query → query will be cached with this key

string keyAsString = $"{nameof(RepositoryMethod.Query)}_{predicate}_{top}_{skip}";

Get → query will be cached with this key

string keyAsString = $"{nameof(RepositoryMethod.Get)}_{key}";

Exist → query will be cached with this key

string keyAsString = $"{nameof(RepositoryMethod.Exist)}_{key}";

Now you can understand the special behavior for commands. If you set Insert and/or Update and/or Delete, during any command if you allowed it for each command automatically the framework will update the cache value, with updated or inserted value or removing the deleted value. The code below allows everything

x.Methods = RepositoryMethod.All

In the example below you're setting up the following behavior: setting up a cache only for Get operation, and update the Get cache when exists a new Insert or an Update, or a removal when Delete operation were perfomed.

x.Methods = RepositoryMethod.Get | RepositoryMethod.Insert | RepositoryMethod.Update | RepositoryMethod.Delete

Setup in DI

builder.Services
.AddRepositoryInBlobStorage<User, string>(builder.Configuration["Storage:ConnectionString"])
.WithInMemoryCache(x =>
{
    x.RefreshTime = TimeSpan.FromSeconds(20);
    x.Methods = RepositoryMethod.All;
})

Usage

You always will find the same interface. For instance

IRepository<User, string> repository

or if you added a query pattern or command pattern

IQuery<User, string> query 
ICommand<User, string> command

Distributed Cache

Based on this link you may use the standard interface IDistributedCache instead of create a custom IDistributedCache<T, TKey, TState>. For instance you may choose between three libraries: Distributed SQL Server cache, Distributed Redis cache, Distributed NCache cache. You need to add the cache

builder.Services.AddStackExchangeRedisCache(options =>
 {
     options.Configuration = builder.Configuration.GetConnectionString("MyRedisConStr");
     options.InstanceName = "SampleInstance";
 });

then you add the IDistributedCache implementation to your repository patterns or CQRS.

builder.Services.
    AddRepository<User, UserRepository>()
    WithDistributedCache();

and as always you will use the standard interface that is automatically integrated in the repository flow.

IRepository<User> repository;
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Rystem.RepositoryFramework.Cache:

Package Downloads
Rystem.RepositoryFramework.Cache.Azure.Storage.Blob

Rystem.RepositoryFramework allows you to use correctly concepts like repository pattern, CQRS and DDD. You have interfaces for your domains, auto-generated api, auto-generated HttpClient to simplify connection "api to front-end", a functionality for auto-population in memory of your models, a functionality to simulate exceptions and waiting time from external sources to improve your implementation/business test and load test.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.1 384 11/12/2025
9.1.3 278 9/2/2025
9.1.2 764,799 5/29/2025
9.1.1 97,890 5/2/2025
9.0.32 186,712 4/15/2025
9.0.31 5,782 4/2/2025
9.0.30 88,793 3/26/2025
9.0.29 8,999 3/18/2025
9.0.28 238 3/17/2025
9.0.27 240 3/16/2025
9.0.26 257 3/13/2025
9.0.25 52,110 3/9/2025
9.0.21 721 3/6/2025
9.0.20 19,577 3/6/2025
9.0.19 316 3/6/2025
9.0.18 304 3/4/2025
9.0.17 193 3/1/2025
9.0.16 193 3/1/2025
9.0.15 75,553 2/22/2025
9.0.14 22,569 2/18/2025
9.0.13 205 2/9/2025
9.0.12 217,985 1/13/2025
9.0.11 24,027 1/9/2025
9.0.10 141 1/9/2025
9.0.9 4,050 1/7/2025
9.0.8 12,538 1/6/2025
9.0.7 182 1/6/2025
9.0.4 92,325 12/23/2024
9.0.3 227 12/22/2024
9.0.2 10,763 12/21/2024
9.0.1 1,249 12/21/2024
9.0.0 173,004 11/16/2024
9.0.0-rc.1 120 10/18/2024
6.2.0 219,145 10/9/2024
6.1.1 210 10/9/2024
6.1.0 47,967 9/29/2024
6.0.24 221 9/11/2024
6.0.23 223 7/18/2024
6.0.21 235 6/18/2024
6.0.20 225 6/16/2024
6.0.19 224 6/14/2024
6.0.18 215 6/14/2024
6.0.17 213 6/14/2024
6.0.16 216 6/10/2024
6.0.15 236 6/9/2024
6.0.14 230 5/24/2024
6.0.13 231 5/23/2024
6.0.12 214 5/23/2024
6.0.11 239 5/20/2024
6.0.9 245 5/20/2024
6.0.7 231 5/18/2024
6.0.6 221 5/10/2024
6.0.5 247 5/10/2024
6.0.4 278 4/3/2024
6.0.3 1,661 3/25/2024
6.0.2 299 3/11/2024
6.0.0 1,078 11/21/2023
6.0.0-rc.6 149 10/25/2023
6.0.0-rc.5 115 10/25/2023
6.0.0-rc.4 113 10/23/2023
6.0.0-rc.3 114 10/19/2023
6.0.0-rc.2 116 10/18/2023
6.0.0-rc.1 122 10/16/2023
5.0.20 608 9/25/2023
5.0.19 594 9/10/2023
5.0.18 586 9/6/2023
5.0.17 555 9/6/2023
5.0.16 639 9/5/2023
5.0.15 585 9/5/2023
5.0.14 582 9/5/2023
5.0.13 578 9/1/2023
5.0.12 547 8/31/2023
5.0.11 577 8/30/2023
5.0.10 611 8/29/2023
5.0.9 591 8/24/2023
5.0.8 597 8/24/2023
5.0.7 624 8/23/2023
5.0.6 654 8/21/2023
5.0.5 610 8/21/2023
5.0.4 642 8/16/2023
5.0.3 705 8/2/2023
5.0.2 662 8/2/2023
5.0.1 692 8/1/2023
5.0.0 696 7/31/2023
4.1.26 721 7/20/2023
4.1.25 689 7/16/2023
4.1.24 820 6/13/2023
4.1.23 726 6/13/2023
4.1.22 1,160 5/30/2023
4.1.21 725 5/20/2023
4.1.20 315,756 4/19/2023
4.1.19 95,678 3/20/2023
4.1.18 847 3/20/2023
4.1.17 814 3/16/2023
4.1.16 822 3/16/2023
4.1.15 809 3/15/2023
4.1.14 1,894 3/9/2023
4.1.13 836 3/7/2023
4.1.12 994 2/10/2023
4.1.11 873 1/26/2023
4.1.10 889 1/22/2023
4.1.9 856 1/20/2023
4.1.8 871 1/18/2023
4.1.7 858 1/18/2023
4.1.6 872 1/17/2023
4.1.1 900 1/4/2023
4.1.0 902 1/1/2023
3.1.5 898 12/21/2022
3.1.3 892 12/12/2022
3.1.2 878 12/7/2022
3.1.1 891 12/7/2022
3.1.0 950 12/2/2022
3.0.29 880 12/1/2022
3.0.28 909 12/1/2022
3.0.27 949 11/23/2022
3.0.25 1,016 11/23/2022
3.0.24 1,026 11/18/2022
3.0.23 1,011 11/18/2022
3.0.22 1,027 11/15/2022
3.0.21 1,006 11/14/2022
3.0.20 1,055 11/13/2022
3.0.19 1,154 11/2/2022
3.0.18 1,018 11/2/2022
3.0.17 1,069 10/29/2022
3.0.16 1,070 10/29/2022
3.0.15 1,066 10/29/2022
3.0.14 1,211 10/24/2022
3.0.13 1,079 10/24/2022
3.0.12 1,077 10/17/2022
3.0.11 1,118 10/10/2022
3.0.10 1,120 10/6/2022
3.0.9 1,112 10/6/2022
3.0.8 1,115 10/6/2022
3.0.7 1,045 10/6/2022
3.0.6 1,110 10/5/2022
3.0.5 973 10/5/2022
3.0.4 1,125 10/5/2022
3.0.3 1,103 10/3/2022
3.0.2 1,101 9/30/2022
3.0.1 1,115 9/30/2022
2.0.17 995 9/29/2022
2.0.16 1,144 9/27/2022
2.0.15 1,183 9/27/2022
2.0.14 1,176 9/26/2022
2.0.13 1,134 9/26/2022
2.0.12 1,128 9/26/2022
2.0.11 1,161 9/25/2022
2.0.10 1,207 9/25/2022
2.0.9 1,167 9/22/2022
2.0.8 1,131 9/22/2022
2.0.6 1,161 9/20/2022
2.0.5 1,315 9/20/2022
2.0.4 1,122 9/20/2022
2.0.2 1,158 9/20/2022
2.0.1 1,208 9/13/2022
2.0.0 1,122 8/19/2022
1.1.24 1,226 7/30/2022
1.1.23 1,189 7/29/2022
1.1.22 1,029 7/29/2022
1.1.21 1,151 7/29/2022
1.1.20 1,198 7/29/2022
1.1.19 1,178 7/27/2022
1.1.17 1,230 7/27/2022
1.1.16 1,147 7/26/2022
1.1.15 1,163 7/25/2022
1.1.14 1,165 7/25/2022
1.1.13 1,154 7/22/2022
1.1.12 1,193 7/19/2022
1.1.11 1,175 7/19/2022
1.1.10 1,147 7/19/2022
1.1.9 1,174 7/19/2022
1.1.8 1,215 7/18/2022
1.1.7 1,164 7/18/2022
1.1.6 1,169 7/18/2022
1.1.5 1,196 7/17/2022
1.1.4 1,041 7/17/2022
1.1.3 1,331 7/17/2022
1.1.2 1,165 7/17/2022
1.1.0 1,202 7/17/2022
1.0.2 1,145 7/15/2022
1.0.1 1,034 7/15/2022
1.0.0 1,187 7/8/2022
0.10.7 1,157 7/7/2022
0.10.2 1,189 7/2/2022
0.10.1 1,204 7/1/2022
0.10.0 1,076 7/1/2022
0.9.10 1,148 6/20/2022
0.9.9 1,158 6/11/2022
0.9.7 1,031 6/9/2022
0.9.6 1,056 6/9/2022