ProducesAttribute Třída

Definice

Filtr, který určuje očekávaný Type výsledek akce a podporované typy obsahu odpovědi. Hodnota ContentTypes se používá k nastavení 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
Dědičnost
ProducesAttribute
Dědičnost
ProducesAttribute
Odvozené
Atributy
Implementuje

Konstruktory

ProducesAttribute(String, String[])

Inicializuje instanci ProducesAttribute s povolenými typy obsahu.

ProducesAttribute(Type)

Inicializuje instanci .ProducesAttribute

Vlastnosti

ContentTypes

Získá nebo nastaví podporované typy obsahu odpovědi. Používá se k nastavení ContentTypes.

Order

Získá hodnotu pořadí pro určení pořadí provádění filtrů. Filtry se spouštějí ve vzestupné číselné hodnotě Order vlastnosti .

Order

Získá hodnotu pořadí pro určení pořadí provádění filtrů. Filtry se spouštějí ve vzestupné číselné hodnotě Order vlastnosti .

(Zděděno od ResultFilterAttribute)
StatusCode

Získá stavový kód HTTP odpovědi.

Type

Získá optimistický návratový typ akce.

Metody

OnResultExecuted(ResultExecutedContext)

Volá se po provedení výsledku akce.

OnResultExecuted(ResultExecutedContext)

Volá se po provedení výsledku akce.

(Zděděno od ResultFilterAttribute)
OnResultExecuting(ResultExecutingContext)

Volá se před provedením výsledku akce.

OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)

Volá se asynchronně před výsledkem akce.

(Zděděno od ResultFilterAttribute)
SetContentTypes(MediaTypeCollection)

Nakonfiguruje kolekci povolených typů obsahu, které může akce vytvořit.

Platí pro