ConnectionBuilderExtensions.Use Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) |
Aggiungere l'oggetto specificato |
Use(IConnectionBuilder, Func<ConnectionContext,Func<Task>,Task>) |
Aggiungere l'oggetto specificato Preferisce usare Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) per migliorare le prestazioni, come illustrato di seguito:
|
Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>)
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
Aggiungere l'oggetto specificato middleware
alla connessione.
Se non si chiama la funzione successiva, usare Run(IConnectionBuilder, Func<ConnectionContext,Task>) invece.
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
Parametri
- connectionBuilder
- IConnectionBuilder
Oggetto IConnectionBuilder.
- middleware
- Func<ConnectionContext,ConnectionDelegate,Task>
Middleware da aggiungere all'oggetto IConnectionBuilder.
Restituisce
Oggetto IConnectionBuilder.
Si applica a
Use(IConnectionBuilder, Func<ConnectionContext,Func<Task>,Task>)
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
- Origine:
- ConnectionBuilderExtensions.cs
Aggiungere l'oggetto specificato middleware
alla connessione.
Se non si chiama la funzione successiva, usare Run(IConnectionBuilder, Func<ConnectionContext,Task>) invece.
Preferisce usare Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) per migliorare le prestazioni, come illustrato di seguito:
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
Parametri
- connectionBuilder
- IConnectionBuilder
Oggetto IConnectionBuilder.
- middleware
- Func<ConnectionContext,Func<Task>,Task>
Middleware da aggiungere all'oggetto IConnectionBuilder.
Restituisce
Oggetto IConnectionBuilder.