ProducesAttribute Classe

Définition

Filtre qui spécifie le type attendu Type que l’action retournera et les types de contenu de réponse pris en charge. La ContentTypes valeur est utilisée pour définir ContentTypes.

public ref class ProducesAttribute : Microsoft::AspNetCore::Mvc::Filters::ResultFilterAttribute, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiResponseMetadataProvider
public ref class ProducesAttribute : Attribute, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiResponseMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter, Microsoft::AspNetCore::Mvc::Filters::IResultFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class ProducesAttribute : Microsoft.AspNetCore.Mvc.Filters.ResultFilterAttribute, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseMetadataProvider
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class ProducesAttribute : Attribute, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter, Microsoft.AspNetCore.Mvc.Filters.IResultFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ProducesAttribute = class
    inherit ResultFilterAttribute
    interface IApiResponseMetadataProvider
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ProducesAttribute = class
    inherit ResultFilterAttribute
    interface IApiResponseMetadataProvider
    interface IFilterMetadata
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ProducesAttribute = class
    inherit Attribute
    interface IResultFilter
    interface IFilterMetadata
    interface IOrderedFilter
    interface IApiResponseMetadataProvider
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ProducesAttribute = class
    inherit Attribute
    interface IApiResponseMetadataProvider
    interface IFilterMetadata
    interface IOrderedFilter
    interface IResultFilter
Public Class ProducesAttribute
Inherits ResultFilterAttribute
Implements IApiResponseMetadataProvider
Public Class ProducesAttribute
Inherits Attribute
Implements IApiResponseMetadataProvider, IOrderedFilter, IResultFilter
Héritage
ProducesAttribute
Héritage
ProducesAttribute
Dérivé
Attributs
Implémente

Constructeurs

ProducesAttribute(String, String[])

Initialise un instance de avec les types de ProducesAttribute contenu autorisés.

ProducesAttribute(Type)

Initialise une instance de ProducesAttribute.

Propriétés

ContentTypes

Obtient ou définit les types de contenu de réponse pris en charge. Utilisé pour définir ContentTypes.

Order

Obtient la valeur d’ordre pour déterminer l’ordre d’exécution des filtres. Les filtres s’exécutent dans la valeur numérique ascendante de la Order propriété.

Order

Obtient la valeur d’ordre pour déterminer l’ordre d’exécution des filtres. Les filtres s’exécutent dans la valeur numérique ascendante de la Order propriété.

(Hérité de ResultFilterAttribute)
StatusCode

Obtient le code HTTP status de la réponse.

Type

Obtient le type de retour optimiste de l’action.

Méthodes

OnResultExecuted(ResultExecutedContext)

Appelée après l'exécution du résultat de l'action.

OnResultExecuted(ResultExecutedContext)

Appelée après l'exécution du résultat de l'action.

(Hérité de ResultFilterAttribute)
OnResultExecuting(ResultExecutingContext)

Appelée avant l'exécution du résultat de l'action.

OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)

Appelé de manière asynchrone avant le résultat de l’action.

(Hérité de ResultFilterAttribute)
SetContentTypes(MediaTypeCollection)

Configure une collection de types de contenu autorisés qui peuvent être générés par l’action.

S’applique à