ConsumesAttribute Třída

Definice

Filtr, který určuje podporované typy obsahu požadavků. ContentTypes slouží k výběru akce, pokud by jinak bylo více shod.

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
Dědičnost
ConsumesAttribute
Atributy
Implementuje

Konstruktory

ConsumesAttribute(String, String[])

Vytvoří novou instanci položky ConsumesAttribute.

ConsumesAttribute(Type, String, String[])

Vytvoří novou instanci položky ConsumesAttribute.

Pole

ConsumesActionConstraintOrder

Atribut order for consumes (Order for consumes).

Vlastnosti

ContentTypes

Získá nebo nastaví podporované typy obsahu požadavku. Slouží k výběru akce, pokud by jinak bylo více shod.

IsOptional

Získá nebo nastaví hodnotu, která určuje, zda je text požadavku volitelný. Tato hodnota slouží pouze k určení, jestli se v Průzkumníku rozhraní API vyžaduje text požadavku.

Metody

Accept(ActionConstraintContext)

Určuje, zda je akce platným kandidátem pro výběr.

OnResourceExecuted(ResourceExecutedContext)

Spustí filtr prostředků. Volá se po spuštění zbytku kanálu.

OnResourceExecuting(ResourceExecutingContext)

Spustí filtr prostředků. Volá se před spuštěním zbytku kanálu.

SetContentTypes(MediaTypeCollection)

Konfiguruje kolekci povolených typů obsahu, které může akce využívat.

Explicitní implementace rozhraní

IAcceptsMetadata.ContentTypes

Filtr, který určuje podporované typy obsahu požadavků. ContentTypes slouží k výběru akce, pokud by jinak bylo více shod.

IAcceptsMetadata.RequestType

Filtr, který určuje podporované typy obsahu požadavků. ContentTypes slouží k výběru akce, pokud by jinak bylo více shod.

IActionConstraint.Order

Pořadí omezení.

Platí pro