Skip to content

SwrServiceCollectionExtensions.AddSwrForBlazor method

SwrServiceCollectionExtensions.AddSwrForBlazor method

Section titled “SwrServiceCollectionExtensions.AddSwrForBlazor method”

Registers Swr.Net services for Blazor applications. ISwr and ISwrStore are registered as Scoped — each Blazor circuit gets its own isolated cache.

public static IServiceCollection AddSwrForBlazor(this IServiceCollection services,
Action<SwrOptions>? configure = null)
parameterdescription
servicesThe service collection.
configureOptional configuration callback for SwrOptions (StaleTime, CacheTime, etc.).

The service collection for chaining.