Skip to content

SwrServiceCollectionExtensions class

Extension methods for registering Swr.Net services with the DI container.

public static class SwrServiceCollectionExtensions
namedescription
static AddSwrForAspNetCore(…)Registers Swr.Net services for ASP.NET Core applications. ISwr and ISwrStore are registered as Singleton — the cache is shared across all requests.
static AddSwrForBlazor(…)Registers Swr.Net services for Blazor applications. ISwr and ISwrStore are registered as Scoped — each Blazor circuit gets its own isolated cache.