ConnectionBuilderExtensions Class

Definition

IConnectionBuilder extensions.

public ref class ConnectionBuilderExtensions abstract sealed
public static class ConnectionBuilderExtensions
type ConnectionBuilderExtensions = class
Public Module ConnectionBuilderExtensions
Inheritance
ConnectionBuilderExtensions

Methods

Run(IConnectionBuilder, Func<ConnectionContext,Task>)

Add the given middleware to the connection.

Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>)

Add the given middleware to the connection. If you aren't calling the next function, use Run(IConnectionBuilder, Func<ConnectionContext,Task>) instead.

Use(IConnectionBuilder, Func<ConnectionContext,Func<Task>,Task>)

Add the given middleware to the connection. If you aren't calling the next function, use Run(IConnectionBuilder, Func<ConnectionContext,Task>) instead.

Prefer using Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) for better performance as shown below:

builder.Use((context, next) =>
{
    return next(context);
});
UseConnectionHandler<TConnectionHandler>(IConnectionBuilder)

Use the given TConnectionHandlerConnectionHandler.

Applies to