ProducesAttribute Sınıf

Tanım

Beklenen eylemi belirten bir filtre Type ve desteklenen yanıt içerik türleri. ContentTypesDeğer ayarlamak için kullanılır 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
Devralma
ProducesAttribute
Devralma
ProducesAttribute
Öznitelikler
Uygulamalar

Oluşturucular

ProducesAttribute(String, String[])

Bir örneğini, ProducesAttribute izin verilen içerik türleri ile başlatır.

ProducesAttribute(Type)

Bir örneğini başlatır ProducesAttribute .

Özellikler

ContentTypes

Desteklenen yanıt içerik türlerini alır veya ayarlar. Ayarlamak için kullanılır ContentTypes .

Order

Filtrelerin yürütme sırası belirlemek için sipariş değerini alır. Filtreler özelliğin artan sayısal değerinde Order yürütülür.

Order

Filtrelerin yürütme sırası belirlemek için sipariş değerini alır. Filtreler özelliğin artan sayısal değerinde Order yürütülür.

(Devralındığı yer: ResultFilterAttribute)
StatusCode

Yanıtın HTTP durum kodunu alır.

Type

Eylemin iyimser dönüş türünü alır.

Yöntemler

OnResultExecuted(ResultExecutedContext)

Eylem sonucu yürütüldükten sonra çağırılır.

OnResultExecuted(ResultExecutedContext)

Eylem sonucu yürütüldükten sonra çağırılır.

(Devralındığı yer: ResultFilterAttribute)
OnResultExecuting(ResultExecutingContext)

Eylem sonucu yürütmeden önce çağırılır.

OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)

Eylem sonucundan önce zaman uyumsuz olarak çağrılır.

(Devralındığı yer: ResultFilterAttribute)
SetContentTypes(MediaTypeCollection)

Eylem tarafından üretilebilen izin verilen bir içerik türleri koleksiyonunu yapılandırır.

Şunlara uygulanır