RequestDelegateFactory.Create Metoda

Definicja

Przeciążenia

Create(Delegate, RequestDelegateFactoryOptions)

Tworzy implementację RequestDelegate dla programu handler.

Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult)

Tworzy implementację RequestDelegate dla programu handler.

Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions)

Tworzy implementację RequestDelegate dla programu methodInfo.

Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions, RequestDelegateMetadataResult)

Tworzy implementację RequestDelegate dla programu methodInfo.

Create(Delegate, RequestDelegateFactoryOptions)

Tworzy implementację RequestDelegate dla programu handler.

public static Microsoft.AspNetCore.Http.RequestDelegateResult Create (Delegate handler, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options = default);
public static Microsoft.AspNetCore.Http.RequestDelegateResult Create (Delegate handler, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options);
static member Create : Delegate * Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions -> Microsoft.AspNetCore.Http.RequestDelegateResult
Public Shared Function Create (handler As Delegate, Optional options As RequestDelegateFactoryOptions = Nothing) As RequestDelegateResult
Public Shared Function Create (handler As Delegate, options As RequestDelegateFactoryOptions) As RequestDelegateResult

Parametry

handler
Delegate

Procedura obsługi żądań z dowolną liczbą parametrów niestandardowych, która często generuje odpowiedź z wartością zwracaną.

options
RequestDelegateFactoryOptions

Element RequestDelegateFactoryOptions używany do konfigurowania zachowania programu obsługi.

Zwraca

Element RequestDelegateResult.

Dotyczy

Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult)

Tworzy implementację RequestDelegate dla programu handler.

public static Microsoft.AspNetCore.Http.RequestDelegateResult Create (Delegate handler, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options = default, Microsoft.AspNetCore.Http.RequestDelegateMetadataResult? metadataResult = default);
static member Create : Delegate * Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions * Microsoft.AspNetCore.Http.RequestDelegateMetadataResult -> Microsoft.AspNetCore.Http.RequestDelegateResult
Public Shared Function Create (handler As Delegate, Optional options As RequestDelegateFactoryOptions = Nothing, Optional metadataResult As RequestDelegateMetadataResult = Nothing) As RequestDelegateResult

Parametry

handler
Delegate

Procedura obsługi żądań z dowolną liczbą parametrów niestandardowych, która często generuje odpowiedź z wartością zwracaną.

options
RequestDelegateFactoryOptions

Element RequestDelegateFactoryOptions używany do konfigurowania zachowania programu obsługi.

metadataResult
RequestDelegateMetadataResult

Wynik zwrócony z InferMetadata(MethodInfo, RequestDelegateFactoryOptions) elementu , jeśli został użyty do wnioskowania metadanych przed utworzeniem końcowego elementu RequestDelegate. Jeśli nullmetoda , to wywołanie Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) metody wywnioskuje metadane, które InferMetadata(MethodInfo, RequestDelegateFactoryOptions) zostałyby wywnioskowane dla tych samych Method metadanych i wypełnione EndpointBuilder tymi metadanymi. W przeciwnym razie to wnioskowanie metadanych zostanie pominięte, ponieważ ten krok został już wykonany.

Zwraca

Element RequestDelegateResult.

Dotyczy

Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions)

Tworzy implementację RequestDelegate dla programu methodInfo.

public static Microsoft.AspNetCore.Http.RequestDelegateResult Create (System.Reflection.MethodInfo methodInfo, Func<Microsoft.AspNetCore.Http.HttpContext,object>? targetFactory = default, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options = default);
public static Microsoft.AspNetCore.Http.RequestDelegateResult Create (System.Reflection.MethodInfo methodInfo, Func<Microsoft.AspNetCore.Http.HttpContext,object>? targetFactory, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options);
static member Create : System.Reflection.MethodInfo * Func<Microsoft.AspNetCore.Http.HttpContext, obj> * Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions -> Microsoft.AspNetCore.Http.RequestDelegateResult
Public Shared Function Create (methodInfo As MethodInfo, Optional targetFactory As Func(Of HttpContext, Object) = Nothing, Optional options As RequestDelegateFactoryOptions = Nothing) As RequestDelegateResult
Public Shared Function Create (methodInfo As MethodInfo, targetFactory As Func(Of HttpContext, Object), options As RequestDelegateFactoryOptions) As RequestDelegateResult

Parametry

methodInfo
MethodInfo

Procedura obsługi żądań z dowolną liczbą parametrów niestandardowych, która często generuje odpowiedź z wartością zwracaną.

targetFactory
Func<HttpContext,Object>

Tworzy metodę this dla metody niestatycznej.

options
RequestDelegateFactoryOptions

Element RequestDelegateFactoryOptions używany do konfigurowania zachowania programu obsługi.

Zwraca

Element RequestDelegate.

Dotyczy

Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions, RequestDelegateMetadataResult)

Tworzy implementację RequestDelegate dla programu methodInfo.

public static Microsoft.AspNetCore.Http.RequestDelegateResult Create (System.Reflection.MethodInfo methodInfo, Func<Microsoft.AspNetCore.Http.HttpContext,object>? targetFactory = default, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options = default, Microsoft.AspNetCore.Http.RequestDelegateMetadataResult? metadataResult = default);
static member Create : System.Reflection.MethodInfo * Func<Microsoft.AspNetCore.Http.HttpContext, obj> * Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions * Microsoft.AspNetCore.Http.RequestDelegateMetadataResult -> Microsoft.AspNetCore.Http.RequestDelegateResult
Public Shared Function Create (methodInfo As MethodInfo, Optional targetFactory As Func(Of HttpContext, Object) = Nothing, Optional options As RequestDelegateFactoryOptions = Nothing, Optional metadataResult As RequestDelegateMetadataResult = Nothing) As RequestDelegateResult

Parametry

methodInfo
MethodInfo

Procedura obsługi żądań z dowolną liczbą parametrów niestandardowych, która często generuje odpowiedź z wartością zwracaną.

targetFactory
Func<HttpContext,Object>

Tworzy metodę this dla metody niestatycznej.

options
RequestDelegateFactoryOptions

Element RequestDelegateFactoryOptions używany do konfigurowania zachowania programu obsługi.

metadataResult
RequestDelegateMetadataResult

Wynik zwrócony z InferMetadata(MethodInfo, RequestDelegateFactoryOptions) elementu , jeśli został użyty do wnioskowania metadanych przed utworzeniem końcowego elementu RequestDelegate. Jeśli nullmetoda , to wywołanie Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) metody wywnioskuje metadane, które InferMetadata(MethodInfo, RequestDelegateFactoryOptions) zostałyby wywnioskowane dla tych samych Method metadanych i wypełnione EndpointBuilder tymi metadanymi. W przeciwnym razie to wnioskowanie metadanych zostanie pominięte, ponieważ ten krok został już wykonany.

Zwraca

Element RequestDelegate.

Dotyczy