Method AddApiResponseHandling
AddApiResponseHandling(IServiceCollection)
Registers the services of UseApiResponseHandling<TBuilder>(TBuilder), including the startup filter that attaches the streaming response conversion to the endpoints when the host builds the middleware pipeline. The app fails to start if it does not call UseApiResponseHandling<TBuilder>(TBuilder).
Declaration
public static IServiceCollection AddApiResponseHandling(this IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services |
Returns
| Type | Description |
|---|---|
| IServiceCollection |
Remarks
In an app that registers SignalR, it also adds the hub filter that confirms to the toolkit's client that a hub accepted its connection, once the
hub's OnConnectedAsync succeeded (see the remarks of ApiHubConnection in the SignalR client library), as
AddHttpSessionHandling<TSessionToken, TSessionStore>(IServiceCollection, JsonTypeInfo<TSessionToken>, Action<SessionHandlingOptions>?)
does.