RequestDelegateFactory.Create Метод
Определение
Важно!
Некоторые сведения относятся к предварительной версии продукта, в которую до выпуска могут быть внесены существенные изменения. Майкрософт не предоставляет никаких гарантий, явных или подразумеваемых, относительно приведенных здесь сведений.
Перегрузки
Create(Delegate, RequestDelegateFactoryOptions) |
Создает реализацию RequestDelegate для |
Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) |
Создает реализацию RequestDelegate для |
Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions) |
Создает реализацию RequestDelegate для |
Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) |
Создает реализацию RequestDelegate для |
Create(Delegate, RequestDelegateFactoryOptions)
- Исходный код:
- 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)
- Исходный код:
- 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
Результат, возвращаемый из InferMetadata(MethodInfo, RequestDelegateFactoryOptions) , если он использовался для вывода метаданных перед созданием окончательного RequestDelegate.
Если null
задано значение , этот вызов метода будет выводить Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) метаданные, которые InferMetadata(MethodInfo, RequestDelegateFactoryOptions) были бы выведены для того же Method , и заполнять EndpointBuilder их соответствующими метаданными. В противном случае вывод метаданных будет пропущен, так как этот шаг уже выполнен.
Возвращаемое значение
Применяется к
Create(MethodInfo, Func<HttpContext,Object>, RequestDelegateFactoryOptions)
- Исходный код:
- 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)
- Исходный код:
- 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
Результат, возвращаемый из InferMetadata(MethodInfo, RequestDelegateFactoryOptions) , если он использовался для вывода метаданных перед созданием окончательного RequestDelegate.
Если null
задано значение , этот вызов метода будет выводить Create(Delegate, RequestDelegateFactoryOptions, RequestDelegateMetadataResult) метаданные, которые InferMetadata(MethodInfo, RequestDelegateFactoryOptions) были бы выведены для того же Method , и заполнять EndpointBuilder их соответствующими метаданными. В противном случае вывод метаданных будет пропущен, так как этот шаг уже выполнен.