Class ServerSentEventsMiddlewareExtensions
Provides extensions for registering middleware which provides support for Server-Sent Events protocol.
Inherited Members
Namespace: Lib.AspNetCore.ServerSentEvents
Assembly: Lib.AspNetCore.ServerSentEvents.dll
Syntax
public static class ServerSentEventsMiddlewareExtensions
Methods
AddDistributedServerSentEventsNoReconnectClientsIdsStore(IServiceCollection)
Registers implementation of IServerSentEventsNoReconnectClientsIdsStore backed by an IDistributedCache.
Declaration
public static IServiceCollection AddDistributedServerSentEventsNoReconnectClientsIdsStore(this IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of service descriptors. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The collection of service descriptors. |
AddInMemoryServerSentEventsNoReconnectClientsIdsStore(IServiceCollection)
Registers implementation of IServerSentEventsNoReconnectClientsIdsStore backed by memory store.
Declaration
public static IServiceCollection AddInMemoryServerSentEventsNoReconnectClientsIdsStore(this IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of service descriptors. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The collection of service descriptors. |
AddServerSentEvents(IServiceCollection)
Registers default service which provides operations over Server-Sent Events protocol.
Declaration
public static IServiceCollection AddServerSentEvents(this IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of service descriptors. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The collection of service descriptors. |
AddServerSentEvents(IServiceCollection, Action<ServerSentEventsServiceOptions<ServerSentEventsService>>)
Registers default service which provides operations over Server-Sent Events protocol.
Declaration
public static IServiceCollection AddServerSentEvents(this IServiceCollection services, Action<ServerSentEventsServiceOptions<ServerSentEventsService>> configureOptions)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of service descriptors. |
| Action<ServerSentEventsServiceOptions<ServerSentEventsService>> | configureOptions | A delegate to configure the ServerSentEventsServiceOptions. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The collection of service descriptors. |
AddServerSentEventsClientIdProvider<TServerSentEventsClientIdProvider>(IServiceCollection)
Registers implementation of IServerSentEventsClientIdProvider.
Declaration
public static IServiceCollection AddServerSentEventsClientIdProvider<TServerSentEventsClientIdProvider>(this IServiceCollection services) where TServerSentEventsClientIdProvider : class, IServerSentEventsClientIdProvider
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of service descriptors. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The collection of service descriptors. |
Type Parameters
| Name | Description |
|---|---|
| TServerSentEventsClientIdProvider | The type of IServerSentEventsClientIdProvider implementation. |
AddServerSentEvents<TIServerSentEventsService, TServerSentEventsService>(IServiceCollection)
Registers custom service which provides operations over Server-Sent Events protocol.
Declaration
public static IServiceCollection AddServerSentEvents<TIServerSentEventsService, TServerSentEventsService>(this IServiceCollection services) where TIServerSentEventsService : class, IServerSentEventsService where TServerSentEventsService : ServerSentEventsService, TIServerSentEventsService
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of service descriptors. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The collection of service descriptors. |
Type Parameters
| Name | Description |
|---|---|
| TIServerSentEventsService | The type of service contract. |
| TServerSentEventsService | The type of service implementation. |
AddServerSentEvents<TIServerSentEventsService, TServerSentEventsService>(IServiceCollection, Action<ServerSentEventsServiceOptions<TServerSentEventsService>>)
Registers custom service which provides operations over Server-Sent Events protocol.
Declaration
public static IServiceCollection AddServerSentEvents<TIServerSentEventsService, TServerSentEventsService>(this IServiceCollection services, Action<ServerSentEventsServiceOptions<TServerSentEventsService>> configureOptions) where TIServerSentEventsService : class, IServerSentEventsService where TServerSentEventsService : ServerSentEventsService, TIServerSentEventsService
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The collection of service descriptors. |
| Action<ServerSentEventsServiceOptions<TServerSentEventsService>> | configureOptions | A delegate to configure the ServerSentEventsServiceOptions. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The collection of service descriptors. |
Type Parameters
| Name | Description |
|---|---|
| TIServerSentEventsService | The type of service contract. |
| TServerSentEventsService | The type of service implementation. |
MapServerSentEvents(IApplicationBuilder, PathString)
Adds the middleware which provides support for Server-Sent Events protocol to the branch of pipeline with default service.
Declaration
public static IApplicationBuilder MapServerSentEvents(this IApplicationBuilder app, PathString pathMatch)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | app | The pipeline builder. |
| PathString | pathMatch | The request path to match. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The pipeline builder. |
MapServerSentEvents(IApplicationBuilder, PathString, ServerSentEventsOptions)
Adds the middleware which provides support for Server-Sent Events protocol to the branch of pipeline with default service.
Declaration
public static IApplicationBuilder MapServerSentEvents(this IApplicationBuilder app, PathString pathMatch, ServerSentEventsOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | app | The pipeline builder. |
| PathString | pathMatch | The request path to match. |
| ServerSentEventsOptions | options | The options. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The pipeline builder. |
MapServerSentEvents<TServerSentEventsService>(IApplicationBuilder, PathString)
Adds the middleware which provides support for Server-Sent Events protocol to the branch of pipeline with custom service.
Declaration
public static IApplicationBuilder MapServerSentEvents<TServerSentEventsService>(this IApplicationBuilder app, PathString pathMatch) where TServerSentEventsService : ServerSentEventsService
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | app | The pipeline builder. |
| PathString | pathMatch | The request path to match. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The pipeline builder. |
Type Parameters
| Name | Description |
|---|---|
| TServerSentEventsService | The type of custom ServerSentEventsService. |
MapServerSentEvents<TServerSentEventsService>(IApplicationBuilder, PathString, ServerSentEventsOptions)
Adds the middleware which provides support for Server-Sent Events protocol to the branch of pipeline with custom service.
Declaration
public static IApplicationBuilder MapServerSentEvents<TServerSentEventsService>(this IApplicationBuilder app, PathString pathMatch, ServerSentEventsOptions options) where TServerSentEventsService : ServerSentEventsService
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | app | The pipeline builder. |
| PathString | pathMatch | The request path to match. |
| ServerSentEventsOptions | options | The options. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The pipeline builder. |
Type Parameters
| Name | Description |
|---|---|
| TServerSentEventsService | The type of custom ServerSentEventsService. |
UseServerSentEvents(IApplicationBuilder)
Adds the middleware which provides support for Server-Sent Events protocol to the pipeline with default service.
Declaration
public static IApplicationBuilder UseServerSentEvents(this IApplicationBuilder app)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | app | The pipeline builder. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The pipeline builder. |
UseServerSentEvents(IApplicationBuilder, ServerSentEventsOptions)
Adds the middleware which provides support for Server-Sent Events protocol to the pipeline with default service.
Declaration
public static IApplicationBuilder UseServerSentEvents(this IApplicationBuilder app, ServerSentEventsOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | app | The pipeline builder. |
| ServerSentEventsOptions | options | The options. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The pipeline builder. |
UseServerSentEvents<TServerSentEventsService>(IApplicationBuilder)
Adds the middleware which provides support for Server-Sent Events protocol to the pipeline with custom service.
Declaration
public static IApplicationBuilder UseServerSentEvents<TServerSentEventsService>(this IApplicationBuilder app) where TServerSentEventsService : ServerSentEventsService
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | app | The pipeline builder. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The pipeline builder. |
Type Parameters
| Name | Description |
|---|---|
| TServerSentEventsService | The type of custom ServerSentEventsService. |
UseServerSentEvents<TServerSentEventsService>(IApplicationBuilder, ServerSentEventsOptions)
Adds the middleware which provides support for Server-Sent Events protocol to the pipeline with custom service.
Declaration
public static IApplicationBuilder UseServerSentEvents<TServerSentEventsService>(this IApplicationBuilder app, ServerSentEventsOptions options) where TServerSentEventsService : ServerSentEventsService
Parameters
| Type | Name | Description |
|---|---|---|
| IApplicationBuilder | app | The pipeline builder. |
| ServerSentEventsOptions | options | The options. |
Returns
| Type | Description |
|---|---|
| IApplicationBuilder | The pipeline builder. |
Type Parameters
| Name | Description |
|---|---|
| TServerSentEventsService | The type of custom ServerSentEventsService. |