ConsumesAttribute Classe

Definição

Um filtro que especifica os tipos de conteúdo de solicitação com suporte. ContentTypes é usado para selecionar uma ação quando, de outra forma, haveria várias correspondências.

public ref class ConsumesAttribute : Attribute, Microsoft::AspNetCore::Mvc::ActionConstraints::IActionConstraint, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiRequestMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IResourceFilter, Microsoft::AspNetCore::Mvc::Internal::IConsumesActionConstraint
public ref class ConsumesAttribute : Attribute, Microsoft::AspNetCore::Mvc::ActionConstraints::IActionConstraint, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiRequestMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IResourceFilter
[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
[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
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class ConsumesAttribute : Attribute, Microsoft.AspNetCore.Http.Metadata.IAcceptsMetadata, Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraint, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IResourceFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ConsumesAttribute = class
    inherit Attribute
    interface IResourceFilter
    interface IFilterMetadata
    interface IConsumesActionConstraint
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ConsumesAttribute = class
    inherit Attribute
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
    interface IFilterMetadata
    interface IResourceFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ConsumesAttribute = class
    inherit Attribute
    interface IResourceFilter
    interface IFilterMetadata
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ConsumesAttribute = class
    inherit Attribute
    interface IResourceFilter
    interface IFilterMetadata
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
    interface IAcceptsMetadata
Public Class ConsumesAttribute
Inherits Attribute
Implements IActionConstraint, IApiRequestMetadataProvider, IConsumesActionConstraint, IResourceFilter
Public Class ConsumesAttribute
Inherits Attribute
Implements IActionConstraint, IApiRequestMetadataProvider, IResourceFilter
Public Class ConsumesAttribute
Inherits Attribute
Implements IAcceptsMetadata, IActionConstraint, IApiRequestMetadataProvider, IResourceFilter
Herança
ConsumesAttribute
Atributos
Implementações

Construtores

ConsumesAttribute(String, String[])

Cria uma nova instância de ConsumesAttribute.

ConsumesAttribute(Type, String, String[])

Cria uma nova instância de ConsumesAttribute.

Campos

ConsumesActionConstraintOrder

A ordem para consome o atributo .

Propriedades

ContentTypes

Obtém ou define os tipos de conteúdo de solicitação com suporte. Usado para selecionar uma ação quando, de outra forma, haveria várias correspondências.

IsOptional

Obtém ou define um valor que determina se o corpo da solicitação é opcional. Esse valor só é usado para especificar se o corpo da solicitação é necessário no Gerenciador de API.

Métodos

Accept(ActionConstraintContext)

Determina se uma ação é uma candidata válida para seleção.

OnResourceExecuted(ResourceExecutedContext)

Executa o filtro de recurso. Chamado após a execução do restante do pipeline.

OnResourceExecuting(ResourceExecutingContext)

Executa o filtro de recurso. Chamado antes da execução do restante do pipeline.

SetContentTypes(MediaTypeCollection)

Configura uma coleção de tipos de conteúdo permitidos que podem ser consumidos pela ação.

Implantações explícitas de interface

IAcceptsMetadata.ContentTypes

Um filtro que especifica os tipos de conteúdo de solicitação com suporte. ContentTypes é usado para selecionar uma ação quando, de outra forma, haveria várias correspondências.

IAcceptsMetadata.RequestType

Um filtro que especifica os tipos de conteúdo de solicitação com suporte. ContentTypes é usado para selecionar uma ação quando, de outra forma, haveria várias correspondências.

IActionConstraint.Order

A ordem de restrição.

Aplica-se a