OpenApiRouteHandlerBuilderExtensions.Accepts 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
Accepts(RouteHandlerBuilder, Type, String, String[]) |
Metadata对于生成 |
Accepts(RouteHandlerBuilder, Type, Boolean, String, String[]) |
Metadata对于生成 |
Accepts<TRequest>(RouteHandlerBuilder, String, String[]) |
Metadata对于生成 |
Accepts<TRequest>(RouteHandlerBuilder, Boolean, String, String[]) |
Metadata对于生成 |
Accepts(RouteHandlerBuilder, Type, String, String[])
Metadata对于生成builder
的所有终结点,将 添加到 IAcceptsMetadata 。
public static Microsoft.AspNetCore.Builder.RouteHandlerBuilder Accepts (this Microsoft.AspNetCore.Builder.RouteHandlerBuilder builder, Type requestType, string contentType, params string[] additionalContentTypes);
static member Accepts : Microsoft.AspNetCore.Builder.RouteHandlerBuilder * Type * string * string[] -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder
<Extension()>
Public Function Accepts (builder As RouteHandlerBuilder, requestType As Type, contentType As String, ParamArray additionalContentTypes As String()) As RouteHandlerBuilder
参数
- builder
- RouteHandlerBuilder
- requestType
- Type
请求正文的类型。
- contentType
- String
终结点接受的请求内容类型。
- additionalContentTypes
- String[]
终结点接受的其他请求内容类型的列表。
返回
可用于 RouteHandlerBuilder 进一步自定义终结点的 。
适用于
Accepts(RouteHandlerBuilder, Type, Boolean, String, String[])
Metadata对于生成builder
的所有终结点,将 添加到 IAcceptsMetadata 。
public static Microsoft.AspNetCore.Builder.RouteHandlerBuilder Accepts (this Microsoft.AspNetCore.Builder.RouteHandlerBuilder builder, Type requestType, bool isOptional, string contentType, params string[] additionalContentTypes);
static member Accepts : Microsoft.AspNetCore.Builder.RouteHandlerBuilder * Type * bool * string * string[] -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder
<Extension()>
Public Function Accepts (builder As RouteHandlerBuilder, requestType As Type, isOptional As Boolean, contentType As String, ParamArray additionalContentTypes As String()) As RouteHandlerBuilder
参数
- builder
- RouteHandlerBuilder
- requestType
- Type
请求正文的类型。
- isOptional
- Boolean
设置一个值,该值确定请求正文是否为可选。
- contentType
- String
终结点接受的请求内容类型。
- additionalContentTypes
- String[]
终结点接受的其他请求内容类型的列表。
返回
可用于 RouteHandlerBuilder 进一步自定义终结点的 。
适用于
Accepts<TRequest>(RouteHandlerBuilder, String, String[])
Metadata对于生成builder
的所有终结点,将 添加到 IAcceptsMetadata 。
public static Microsoft.AspNetCore.Builder.RouteHandlerBuilder Accepts<TRequest> (this Microsoft.AspNetCore.Builder.RouteHandlerBuilder builder, string contentType, params string[] additionalContentTypes);
static member Accepts : Microsoft.AspNetCore.Builder.RouteHandlerBuilder * string * string[] -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder
<Extension()>
Public Function Accepts(Of TRequest) (builder As RouteHandlerBuilder, contentType As String, ParamArray additionalContentTypes As String()) As RouteHandlerBuilder
类型参数
- TRequest
请求正文的类型。
参数
- builder
- RouteHandlerBuilder
- contentType
- String
终结点接受的请求内容类型。
- additionalContentTypes
- String[]
终结点接受的其他请求内容类型的列表。
返回
可用于 RouteHandlerBuilder 进一步自定义终结点的 。
适用于
Accepts<TRequest>(RouteHandlerBuilder, Boolean, String, String[])
Metadata对于生成builder
的所有终结点,将 添加到 IAcceptsMetadata 。
public static Microsoft.AspNetCore.Builder.RouteHandlerBuilder Accepts<TRequest> (this Microsoft.AspNetCore.Builder.RouteHandlerBuilder builder, bool isOptional, string contentType, params string[] additionalContentTypes);
static member Accepts : Microsoft.AspNetCore.Builder.RouteHandlerBuilder * bool * string * string[] -> Microsoft.AspNetCore.Builder.RouteHandlerBuilder
<Extension()>
Public Function Accepts(Of TRequest) (builder As RouteHandlerBuilder, isOptional As Boolean, contentType As String, ParamArray additionalContentTypes As String()) As RouteHandlerBuilder
类型参数
- TRequest
请求正文的类型。
参数
- builder
- RouteHandlerBuilder
- isOptional
- Boolean
设置一个值,该值确定请求正文是否为可选。
- contentType
- String
终结点接受的请求内容类型。
- additionalContentTypes
- String[]
终结点接受的其他请求内容类型的列表。
返回
可用于 RouteHandlerBuilder 进一步自定义终结点的 。