ConnectionBuilderExtensions.Use Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Sobrecargas
Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) |
Agregue el especificado |
Use(IConnectionBuilder, Func<ConnectionContext,Func<Task>,Task>) |
Agregue el especificado Prefiere usar Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) para mejorar el rendimiento, como se muestra a continuación:
|
Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>)
Agregue el especificado middleware
a la conexión.
Si no llama a la siguiente función, use Run(IConnectionBuilder, Func<ConnectionContext,Task>) en su lugar.
public static Microsoft.AspNetCore.Connections.IConnectionBuilder Use (this Microsoft.AspNetCore.Connections.IConnectionBuilder connectionBuilder, Func<Microsoft.AspNetCore.Connections.ConnectionContext,Microsoft.AspNetCore.Connections.ConnectionDelegate,System.Threading.Tasks.Task> middleware);
static member Use : Microsoft.AspNetCore.Connections.IConnectionBuilder * Func<Microsoft.AspNetCore.Connections.ConnectionContext, Microsoft.AspNetCore.Connections.ConnectionDelegate, System.Threading.Tasks.Task> -> Microsoft.AspNetCore.Connections.IConnectionBuilder
<Extension()>
Public Function Use (connectionBuilder As IConnectionBuilder, middleware As Func(Of ConnectionContext, ConnectionDelegate, Task)) As IConnectionBuilder
Parámetros
- connectionBuilder
- IConnectionBuilder
- middleware
- Func<ConnectionContext,ConnectionDelegate,Task>
Middleware que se va a agregar a IConnectionBuilder.
Devoluciones
Se aplica a
Use(IConnectionBuilder, Func<ConnectionContext,Func<Task>,Task>)
Agregue el especificado middleware
a la conexión.
Si no llama a la siguiente función, use Run(IConnectionBuilder, Func<ConnectionContext,Task>) en su lugar.
Prefiere usar Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) para mejorar el rendimiento, como se muestra a continuación:
builder.Use((context, next) =>
{
return next(context);
});
public:
[System::Runtime::CompilerServices::Extension]
static Microsoft::AspNetCore::Connections::IConnectionBuilder ^ Use(Microsoft::AspNetCore::Connections::IConnectionBuilder ^ connectionBuilder, Func<Microsoft::AspNetCore::Connections::ConnectionContext ^, Func<System::Threading::Tasks::Task ^> ^, System::Threading::Tasks::Task ^> ^ middleware);
public static Microsoft.AspNetCore.Connections.IConnectionBuilder Use (this Microsoft.AspNetCore.Connections.IConnectionBuilder connectionBuilder, Func<Microsoft.AspNetCore.Connections.ConnectionContext,Func<System.Threading.Tasks.Task>,System.Threading.Tasks.Task> middleware);
static member Use : Microsoft.AspNetCore.Connections.IConnectionBuilder * Func<Microsoft.AspNetCore.Connections.ConnectionContext, Func<System.Threading.Tasks.Task>, System.Threading.Tasks.Task> -> Microsoft.AspNetCore.Connections.IConnectionBuilder
<Extension()>
Public Function Use (connectionBuilder As IConnectionBuilder, middleware As Func(Of ConnectionContext, Func(Of Task), Task)) As IConnectionBuilder
Parámetros
- connectionBuilder
- IConnectionBuilder
- middleware
- Func<ConnectionContext,Func<Task>,Task>
Middleware que se va a agregar a IConnectionBuilder.