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)| parameter | description |
|---|---|
| services | The service collection. |
| configure | Optional configuration callback for SwrOptions (StaleTime, CacheTime, etc.). |
Return Value
Section titled “Return Value”The service collection for chaining.
See Also
Section titled “See Also”- record SwrOptions
- class SwrServiceCollectionExtensions
- namespace Swr.Net.Extensions