Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
aritchie committed Jun 29, 2024
2 parents 3c62342 + 6b5bcbe commit 72044f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Build.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"src\\Shiny.Mediator.Contracts\\Shiny.Mediator.Contracts.csproj",
"src\\Shiny.Mediator.Blazor\\Shiny.Mediator.Blazor.csproj",
"src\\Shiny.Mediator.Maui\\Shiny.Mediator.Maui.csproj",
"src\\Shiny.Mediator.Caching\\Shiny.Mediator.Caching.csproj",
"src\\Shiny.Mediator.Resilience\\Shiny.Mediator.Resilience.csproj",
"src\\Shiny.Mediator.SourceGenerators\\Shiny.Mediator.SourceGenerators.csproj"
]
Expand Down
4 changes: 2 additions & 2 deletions src/Shiny.Mediator.Caching/CacheExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ namespace Shiny.Mediator;

public static class CacheExtensions
{
public static ShinyConfigurator AddMemoryCaching(this ShinyConfigurator cfg, Action<MemoryCacheOptions> configureCache)
public static ShinyConfigurator AddMemoryCaching(this ShinyConfigurator cfg, Action<MemoryCacheOptions>? configureCache = null)
{
cfg.Services.AddMemoryCache(configureCache);
cfg.Services.AddMemoryCache(x => configureCache?.Invoke(x));
cfg.Services.AddSingleton<IEventHandler<FlushAllStoresEvent>, FlushCacheEventHandler>();
cfg.AddOpenRequestMiddleware(typeof(CachingRequestMiddleware<,>));
return cfg;
Expand Down

0 comments on commit 72044f9

Please sign in to comment.