Dela via


RequestDelegateFactory.Create Method

Definition

Overloads

Create(Delegate, RequestDelegateFactoryOptions)

Creates a RequestDelegate implementation for handler.

Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult)

Creates a RequestDelegate implementation for handler.

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

Creates a RequestDelegate implementation for methodInfo.

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

Creates a RequestDelegate implementation for methodInfo.

Create(Delegate, RequestDelegateFactoryOptions)

Source:
RequestDelegateFactory.cs

Creates a RequestDelegate implementation for 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

Parameters

handler
Delegate

A request handler with any number of custom parameters that often produces a response with its return value.

options
RequestDelegateFactoryOptions

The RequestDelegateFactoryOptions used to configure the behavior of the handler.

Returns

The RequestDelegateResult.

Applies to

Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult)

Source:
RequestDelegateFactory.cs

Creates a RequestDelegate implementation for 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

Parameters

handler
Delegate

A request handler with any number of custom parameters that often produces a response with its return value.

options
RequestDelegateFactoryOptions

The RequestDelegateFactoryOptions used to configure the behavior of the handler.

metadataResult
RequestDelegateMetadataResult

The result returned from InferMetadata(MethodInfo, RequestDelegateFactoryOptions) if that was used to inferring metadata before creating the final RequestDelegate. If null, this call to Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) method will infer the metadata that InferMetadata(MethodInfo, RequestDelegateFactoryOptions) would have inferred for the same Method and populate EndpointBuilder with that metadata. Otherwise, this metadata inference will be skipped as this step has already been done.

Returns

The RequestDelegateResult.

Applies to

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

Source:
RequestDelegateFactory.cs

Creates a RequestDelegate implementation for 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

Parameters

methodInfo
MethodInfo

A request handler with any number of custom parameters that often produces a response with its return value.

targetFactory
Func<HttpContext,Object>

Creates the this for the non-static method.

options
RequestDelegateFactoryOptions

The RequestDelegateFactoryOptions used to configure the behavior of the handler.

Returns

The RequestDelegate.

Applies to

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

Source:
RequestDelegateFactory.cs

Creates a RequestDelegate implementation for 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

Parameters

methodInfo
MethodInfo

A request handler with any number of custom parameters that often produces a response with its return value.

targetFactory
Func<HttpContext,Object>

Creates the this for the non-static method.

options
RequestDelegateFactoryOptions

The RequestDelegateFactoryOptions used to configure the behavior of the handler.

metadataResult
RequestDelegateMetadataResult

The result returned from InferMetadata(MethodInfo, RequestDelegateFactoryOptions) if that was used to inferring metadata before creating the final RequestDelegate. If null, this call to Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) method will infer the metadata that InferMetadata(MethodInfo, RequestDelegateFactoryOptions) would have inferred for the same Method and populate EndpointBuilder with that metadata. Otherwise, this metadata inference will be skipped as this step has already been done.

Returns

The RequestDelegate.

Applies to