File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1-
21One More Lib For MediatR
32========================
43[ ![ CI] ( https://github.com/pascal-libaud/One.More.Lib.For.MediatR/actions/workflows/ci.yml/badge.svg )] ( https://github.com/pascal-libaud/One.More.Lib.For.MediatR/actions/workflows/ci.yml ) [ ![ NuGet] ( https://img.shields.io/nuget/v/One.More.Lib.For.MediatR.svg )] ( https://www.nuget.org/packages/One.More.Lib.For.MediatR/ )
@@ -48,11 +47,20 @@ The simplest way:
4847builder .Services .AddMediatRExtensions (configuration => configuration .MemoryCacheSupport = true );
4948```
5049
51- If you want to configure it :
50+ If you want a complete configuration :
5251``` csharp
5352builder .Services .AddMediatRExtensions (configuration => configuration .AddMemoryCacheSupport (slidingExpiration : TimeSpan .FromMinutes (10 ), priority : CacheItemPriority .Low ));
5453```
5554
55+ Or create a specific configuration for a given request:
56+ ``` csharp
57+ builder .Services .AddMediatRExtensions (cfg =>
58+ {
59+ cfg .AddMemoryCacheSupport (slidingExpiration : TimeSpan .FromMinutes (10 ), priority : CacheItemPriority .Low );
60+ cfg .AddMemoryCacheSupportOverrideFor <GiveRequest >(priority : CacheItemPriority .High );
61+ }
62+ ```
63+
5664### How yo use it?
5765
5866Just add [MemoryCache] attribute on requests classes or records.
You can’t perform that action at this time.
0 commit comments