Class ServiceCollectionExtensions
Extension methods for registering HTTP API services in an IServiceCollection.
Namespace: Singulink.Net.Http.Api.Service
Assembly: Singulink.Net.Http.Api.Service.dll
Syntax
public static class ServiceCollectionExtensions
Methods
| Name | Description |
|---|---|
| AddAllowedOrigins(IServiceCollection, params string[]) | Registers allowed origins and CORS services. |
| AddApiExceptionHandler(IServiceCollection) | Registers the default ApiExceptionHandler, which reports API exceptions as-is and logs unexpected exceptions with a reference ID that is reported to the client (or propagates them in development environments). |
| AddApiExceptionHandler<THandler>(IServiceCollection) | Registers an IApiExceptionHandler that maps exceptions thrown during request processing to the errors reported to clients. Derive from ApiExceptionHandler to customize the default behavior with application-specific exception mappings. |
| AddHttpSessionHandling<TSessionToken, TSessionData, TSessionStoreContextFactory>(IServiceCollection, Action<SessionHandlingOptions>?) | Registers services required for enabling HTTP session handling. |