ConsumesAttribute ConsumesAttribute ConsumesAttribute Class

Definition

A filter that specifies the supported request content types. ContentTypes is used to select an action when there would otherwise be multiple matches.

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class ConsumesAttribute : Attribute, Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraint, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IResourceFilter, Microsoft.AspNetCore.Mvc.Internal.IConsumesActionConstraint
type ConsumesAttribute = class
    inherit Attribute
    interface IResourceFilter
    interface IFilterMetadata
    interface IConsumesActionConstraint
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
Public Class ConsumesAttribute
Inherits Attribute
Implements IActionConstraint, IApiRequestMetadataProvider, IConsumesActionConstraint, IResourceFilter
Inheritance
ConsumesAttributeConsumesAttributeConsumesAttribute
Attributes
Implements

Constructors

ConsumesAttribute(String, String[]) ConsumesAttribute(String, String[]) ConsumesAttribute(String, String[])

Creates a new instance of ConsumesAttribute.

Fields

ConsumesActionConstraintOrder ConsumesActionConstraintOrder ConsumesActionConstraintOrder

Properties

ContentTypes ContentTypes ContentTypes

Gets or sets the supported request content types. Used to select an action when there would otherwise be multiple matches.

Methods

Accept(ActionConstraintContext) Accept(ActionConstraintContext) Accept(ActionConstraintContext)
OnResourceExecuted(ResourceExecutedContext) OnResourceExecuted(ResourceExecutedContext) OnResourceExecuted(ResourceExecutedContext)
OnResourceExecuting(ResourceExecutingContext) OnResourceExecuting(ResourceExecutingContext) OnResourceExecuting(ResourceExecutingContext)
SetContentTypes(MediaTypeCollection) SetContentTypes(MediaTypeCollection) SetContentTypes(MediaTypeCollection)

Explicit Interface Implementations

IActionConstraint.Order IActionConstraint.Order IActionConstraint.Order

Applies to