OpenApiRouteHandlerBuilderExtensions.Accepts 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
Accepts(RouteHandlerBuilder, Type, String, String[]) |
針對 IAcceptsMetadata 所產生的 |
Accepts(RouteHandlerBuilder, Type, Boolean, String, String[]) |
針對 IAcceptsMetadata 所產生的 |
Accepts<TRequest>(RouteHandlerBuilder, String, String[]) |
針對 IAcceptsMetadata 所產生的 |
Accepts<TRequest>(RouteHandlerBuilder, Boolean, String, String[]) |
針對 IAcceptsMetadata 所產生的 |
Accepts(RouteHandlerBuilder, Type, String, String[])
針對 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
參數
- builder
- RouteHandlerBuilder
- requestType
- Type
要求本文的類型。
- contentType
- String
端點接受的要求內容類型。
- additionalContentTypes
- String[]
端點接受的其他要求內容類型清單。
傳回
RouteHandlerBuilder,可用來進一步自訂端點。
適用於
Accepts(RouteHandlerBuilder, Type, Boolean, String, String[])
針對 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
參數
- builder
- RouteHandlerBuilder
- requestType
- Type
要求本文的類型。
- isOptional
- Boolean
設定值,判斷要求本文是否為選擇性。
- contentType
- String
端點接受的要求內容類型。
- additionalContentTypes
- String[]
端點接受的其他要求內容類型清單。
傳回
RouteHandlerBuilder,可用來進一步自訂端點。
適用於
Accepts<TRequest>(RouteHandlerBuilder, String, String[])
針對 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
要求本文的類型。
參數
- builder
- RouteHandlerBuilder
- contentType
- String
端點接受的要求內容類型。
- additionalContentTypes
- String[]
端點接受的其他要求內容類型清單。
傳回
RouteHandlerBuilder,可用來進一步自訂端點。
適用於
Accepts<TRequest>(RouteHandlerBuilder, Boolean, String, String[])
針對 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
要求本文的類型。
參數
- builder
- RouteHandlerBuilder
- isOptional
- Boolean
設定值,判斷要求本文是否為選擇性。
- contentType
- String
端點接受的要求內容類型。
- additionalContentTypes
- String[]
端點接受的其他要求內容類型清單。
傳回
RouteHandlerBuilder,可用來進一步自訂端點。