다음을 통해 공유


ConnectionBuilderExtensions.Use 메서드

정의

오버로드

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

지정된 middleware 를 연결에 추가합니다. 다음 함수를 호출하지 않는 경우 대신 를 사용합니다 Run(IConnectionBuilder, Func<ConnectionContext,Task>) .

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

지정된 middleware 를 연결에 추가합니다. 다음 함수를 호출하지 않는 경우 대신 를 사용합니다 Run(IConnectionBuilder, Func<ConnectionContext,Task>) .

아래와 같이 더 나은 성능을 위해 를 사용하는 Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) 것이 좋습니다.

builder.Use((context, next) =>
{
    return next(context);
});

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

Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs

지정된 middleware 를 연결에 추가합니다. 다음 함수를 호출하지 않는 경우 대신 를 사용합니다 Run(IConnectionBuilder, Func<ConnectionContext,Task>) .

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

매개 변수

middleware
Func<ConnectionContext,ConnectionDelegate,Task>

에 추가할 미들웨어입니다 IConnectionBuilder.

반환

IConnectionBuilder

적용 대상

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

Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs
Source:
ConnectionBuilderExtensions.cs

지정된 middleware 를 연결에 추가합니다. 다음 함수를 호출하지 않는 경우 대신 를 사용합니다 Run(IConnectionBuilder, Func<ConnectionContext,Task>) .

아래와 같이 더 나은 성능을 위해 를 사용하는 Use(IConnectionBuilder, Func<ConnectionContext,ConnectionDelegate,Task>) 것이 좋습니다.

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

매개 변수

middleware
Func<ConnectionContext,Func<Task>,Task>

에 추가할 미들웨어입니다 IConnectionBuilder.

반환

IConnectionBuilder

적용 대상