OpenApiRouteHandlerBuilderExtensions.Accepts 方法

定义

重载

Accepts(RouteHandlerBuilder, Type, String, String[])

Metadata对于生成builder的所有终结点,将 添加到 IAcceptsMetadata

Accepts(RouteHandlerBuilder, Type, Boolean, String, String[])

Metadata对于生成builder的所有终结点,将 添加到 IAcceptsMetadata

Accepts<TRequest>(RouteHandlerBuilder, String, String[])

Metadata对于生成builder的所有终结点,将 添加到 IAcceptsMetadata

Accepts<TRequest>(RouteHandlerBuilder, Boolean, String, String[])

Metadata对于生成builder的所有终结点,将 添加到 IAcceptsMetadata

Accepts(RouteHandlerBuilder, Type, String, String[])

Source:
OpenApiRouteHandlerBuilderExtensions.cs

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

参数

requestType
Type

请求正文的类型。

contentType
String

终结点接受的请求内容类型。

additionalContentTypes
String[]

终结点接受的其他请求内容类型的列表。

返回

可用于 RouteHandlerBuilder 进一步自定义终结点的 。

适用于

Accepts(RouteHandlerBuilder, Type, Boolean, String, String[])

Source:
OpenApiRouteHandlerBuilderExtensions.cs

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

参数

requestType
Type

请求正文的类型。

isOptional
Boolean

设置一个值,该值确定请求正文是否为可选。

contentType
String

终结点接受的请求内容类型。

additionalContentTypes
String[]

终结点接受的其他请求内容类型的列表。

返回

可用于 RouteHandlerBuilder 进一步自定义终结点的 。

适用于

Accepts<TRequest>(RouteHandlerBuilder, String, String[])

Source:
OpenApiRouteHandlerBuilderExtensions.cs

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

请求正文的类型。

参数

contentType
String

终结点接受的请求内容类型。

additionalContentTypes
String[]

终结点接受的其他请求内容类型的列表。

返回

可用于 RouteHandlerBuilder 进一步自定义终结点的 。

适用于

Accepts<TRequest>(RouteHandlerBuilder, Boolean, String, String[])

Source:
OpenApiRouteHandlerBuilderExtensions.cs

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

请求正文的类型。

参数

isOptional
Boolean

设置一个值,该值确定请求正文是否为可选。

contentType
String

终结点接受的请求内容类型。

additionalContentTypes
String[]

终结点接受的其他请求内容类型的列表。

返回

可用于 RouteHandlerBuilder 进一步自定义终结点的 。

适用于