SwrServiceCollectionExtensions.AddSwrForAspNetCore method
SwrServiceCollectionExtensions.AddSwrForAspNetCore method
Section titled “SwrServiceCollectionExtensions.AddSwrForAspNetCore method”Registers Swr.Net services for ASP.NET Core applications. ISwr and ISwrStore are registered as Singleton — the cache is shared across all requests.
public static IServiceCollection AddSwrForAspNetCore(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