OpenApiRouteHandlerBuilderExtensions.Accepts Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Accepts(RouteHandlerBuilder, Type, String, String[]) |
Adds IAcceptsMetadata to Metadata for all endpoints
produced by |
Accepts(RouteHandlerBuilder, Type, Boolean, String, String[]) |
Adds IAcceptsMetadata to Metadata for all endpoints
produced by |
Accepts<TRequest>(RouteHandlerBuilder, String, String[]) |
Adds IAcceptsMetadata to Metadata for all endpoints
produced by |
Accepts<TRequest>(RouteHandlerBuilder, Boolean, String, String[]) |
Adds IAcceptsMetadata to Metadata for all endpoints
produced by |
Accepts(RouteHandlerBuilder, Type, String, String[])
Adds IAcceptsMetadata to Metadata for all endpoints
produced by builder
.
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
Parameters
- builder
- RouteHandlerBuilder
The RouteHandlerBuilder.
- requestType
- Type
The type of the request body.
- contentType
- String
The request content type that the endpoint accepts.
- additionalContentTypes
- String[]
The list of additional request content types that the endpoint accepts.
Returns
A RouteHandlerBuilder that can be used to further customize the endpoint.
Applies to
Accepts(RouteHandlerBuilder, Type, Boolean, String, String[])
Adds IAcceptsMetadata to Metadata for all endpoints
produced by builder
.
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
Parameters
- builder
- RouteHandlerBuilder
The RouteHandlerBuilder.
- requestType
- Type
The type of the request body.
- isOptional
- Boolean
Sets a value that determines if the request body is optional.
- contentType
- String
The request content type that the endpoint accepts.
- additionalContentTypes
- String[]
The list of additional request content types that the endpoint accepts.
Returns
A RouteHandlerBuilder that can be used to further customize the endpoint.
Applies to
Accepts<TRequest>(RouteHandlerBuilder, String, String[])
Adds IAcceptsMetadata to Metadata for all endpoints
produced by builder
.
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
Type Parameters
- TRequest
The type of the request body.
Parameters
- builder
- RouteHandlerBuilder
The RouteHandlerBuilder.
- contentType
- String
The request content type that the endpoint accepts.
- additionalContentTypes
- String[]
The list of additional request content types that the endpoint accepts.
Returns
A RouteHandlerBuilder that can be used to further customize the endpoint.
Applies to
Accepts<TRequest>(RouteHandlerBuilder, Boolean, String, String[])
Adds IAcceptsMetadata to Metadata for all endpoints
produced by builder
.
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
Type Parameters
- TRequest
The type of the request body.
Parameters
- builder
- RouteHandlerBuilder
The RouteHandlerBuilder.
- isOptional
- Boolean
Sets a value that determines if the request body is optional.
- contentType
- String
The request content type that the endpoint accepts.
- additionalContentTypes
- String[]
The list of additional request content types that the endpoint accepts.
Returns
A RouteHandlerBuilder that can be used to further customize the endpoint.