RequestDelegateFactory.Create 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Create(Delegate, RequestDelegateFactoryOptions)
- Source:
- RequestDelegateFactory.cs
RequestDelegate为 创建实现handler
。
public static Microsoft.AspNetCore.Http.RequestDelegateResult Create(Delegate handler, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options);
public static Microsoft.AspNetCore.Http.RequestDelegateResult Create(Delegate handler, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options = default);
static member Create : Delegate * Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions -> Microsoft.AspNetCore.Http.RequestDelegateResult
Public Shared Function Create (handler As Delegate, options As RequestDelegateFactoryOptions) As RequestDelegateResult
Public Shared Function Create (handler As Delegate, Optional options As RequestDelegateFactoryOptions = Nothing) As RequestDelegateResult
参数
- handler
- Delegate
具有任意数量的自定义参数的请求处理程序,这些参数通常生成具有其返回值的响应。
- options
- RequestDelegateFactoryOptions
RequestDelegateFactoryOptions用于配置处理程序行为的 。
返回
适用于
Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult)
- Source:
- RequestDelegateFactory.cs
RequestDelegate为 创建实现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
参数
- handler
- Delegate
具有任意数量的自定义参数的请求处理程序,这些参数通常生成具有其返回值的响应。
- options
- RequestDelegateFactoryOptions
RequestDelegateFactoryOptions用于配置处理程序行为的 。
- metadataResult
- RequestDelegateMetadataResult
如果 用于在创建最终 RequestDelegate 之前推断元数据,则返回的结果 InferMetadata(MethodInfo, RequestDelegateFactoryOptions) 。
如果 null
为 ,则对 方法的 Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) 此调用将推断 InferMetadata(MethodInfo, RequestDelegateFactoryOptions) 出已为相同 Method 的元数据,并 EndpointBuilder 填充该元数据。 否则,将跳过此元数据推理,因为此步骤已完成。
返回
适用于
Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions)
- Source:
- RequestDelegateFactory.cs
RequestDelegate为 创建实现methodInfo
。
public static Microsoft.AspNetCore.Http.RequestDelegateResult Create(System.Reflection.MethodInfo methodInfo, Func<Microsoft.AspNetCore.Http.HttpContext,object>? targetFactory, Microsoft.AspNetCore.Http.RequestDelegateFactoryOptions? options);
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);
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, targetFactory As Func(Of HttpContext, Object), options As RequestDelegateFactoryOptions) As RequestDelegateResult
Public Shared Function Create (methodInfo As MethodInfo, Optional targetFactory As Func(Of HttpContext, Object) = Nothing, Optional options As RequestDelegateFactoryOptions = Nothing) As RequestDelegateResult
参数
- methodInfo
- MethodInfo
具有任意数量的自定义参数的请求处理程序,这些参数通常生成具有其返回值的响应。
- targetFactory
- Func<HttpContext,Object>
this
为非静态方法创建 。
- options
- RequestDelegateFactoryOptions
RequestDelegateFactoryOptions用于配置处理程序行为的 。
返回
适用于
Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions, RequestDelegateMetadataResult)
- Source:
- RequestDelegateFactory.cs
RequestDelegate为 创建实现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
参数
- methodInfo
- MethodInfo
具有任意数量的自定义参数的请求处理程序,这些参数通常生成具有其返回值的响应。
- targetFactory
- Func<HttpContext,Object>
this
为非静态方法创建 。
- options
- RequestDelegateFactoryOptions
RequestDelegateFactoryOptions用于配置处理程序行为的 。
- metadataResult
- RequestDelegateMetadataResult
如果 用于在创建最终 RequestDelegate 之前推断元数据,则返回的结果 InferMetadata(MethodInfo, RequestDelegateFactoryOptions) 。
如果 null
为 ,则对 方法的 Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) 此调用将推断 InferMetadata(MethodInfo, RequestDelegateFactoryOptions) 出已为相同 Method 的元数据,并 EndpointBuilder 填充该元数据。 否则,将跳过此元数据推理,因为此步骤已完成。