ProducesAttribute Klasa

Definicja

Filtr określający oczekiwaną Type akcję zwróci i obsługiwane typy zawartości odpowiedzi. Wartość ContentTypes jest używana do ustawiania ContentTypeswartości .

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
Dziedziczenie
ProducesAttribute
Dziedziczenie
ProducesAttribute
Pochodne
Atrybuty
Implementuje

Konstruktory

ProducesAttribute(String, String[])

Inicjuje wystąpienie z ProducesAttribute dozwolonymi typami zawartości.

ProducesAttribute(Type)

Inicjuje wystąpienie klasy ProducesAttribute.

Właściwości

ContentTypes

Pobiera lub ustawia obsługiwane typy zawartości odpowiedzi. Służy do ustawiania .ContentTypes

Order

Pobiera wartość zamówienia do określania kolejności wykonywania filtrów. Filtry są wykonywane w rosnącej wartości liczbowej Order właściwości.

Order

Pobiera wartość zamówienia do określania kolejności wykonywania filtrów. Filtry są wykonywane w rosnącej wartości liczbowej Order właściwości.

(Odziedziczone po ResultFilterAttribute)
StatusCode

Pobiera kod stanu HTTP odpowiedzi.

Type

Pobiera optymistyczny typ powrotu akcji.

Metody

OnResultExecuted(ResultExecutedContext)

Wywołana po wykonaniu wyniku akcji.

OnResultExecuted(ResultExecutedContext)

Wywołana po wykonaniu wyniku akcji.

(Odziedziczone po ResultFilterAttribute)
OnResultExecuting(ResultExecutingContext)

Wywołana przed wykonaniem wyniku akcji.

OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)

Wywołana asynchronicznie przed wynikiem akcji.

(Odziedziczone po ResultFilterAttribute)
SetContentTypes(MediaTypeCollection)

Konfiguruje kolekcję dozwolonych typów zawartości, które mogą być generowane przez akcję.

Dotyczy