共用方式為


OpenApiRouteHandlerBuilderExtensions.Accepts 方法

定義

多載

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

針對 IAcceptsMetadata 所產生的 builder 所有端點新增至 Metadata

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

針對 IAcceptsMetadata 所產生的 builder 所有端點新增至 Metadata

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

針對 IAcceptsMetadata 所產生的 builder 所有端點新增至 Metadata

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

針對 IAcceptsMetadata 所產生的 builder 所有端點新增至 Metadata

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

來源:
OpenApiRouteHandlerBuilderExtensions.cs

針對 IAcceptsMetadata 所產生的 builder 所有端點新增至 Metadata

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[])

來源:
OpenApiRouteHandlerBuilderExtensions.cs

針對 IAcceptsMetadata 所產生的 builder 所有端點新增至 Metadata

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[])

來源:
OpenApiRouteHandlerBuilderExtensions.cs

針對 IAcceptsMetadata 所產生的 builder 所有端點新增至 Metadata

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[])

來源:
OpenApiRouteHandlerBuilderExtensions.cs

針對 IAcceptsMetadata 所產生的 builder 所有端點新增至 Metadata

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,可用來進一步自訂端點。

適用於