Share via


ProducesAttribute Kelas

Definisi

Filter yang menentukan tindakan yang diharapkan Type akan kembali dan jenis konten respons yang didukung. Nilai ContentTypes digunakan untuk mengatur 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
Warisan
ProducesAttribute
Warisan
ProducesAttribute
Turunan
Atribut
Penerapan

Konstruktor

ProducesAttribute(String, String[])

Menginisialisasi instans ProducesAttribute dengan jenis konten yang diizinkan.

ProducesAttribute(Type)

Menginisialisasi instans ProducesAttribute.

Properti

ContentTypes

Mendapatkan atau mengatur jenis konten respons yang didukung. Digunakan untuk mengatur ContentTypes.

Order

Mendapatkan nilai pesanan untuk menentukan urutan eksekusi filter. Filter dijalankan dalam nilai numerik naik dari Order properti .

Order

Mendapatkan nilai pesanan untuk menentukan urutan eksekusi filter. Filter dijalankan dalam nilai numerik naik dari Order properti .

(Diperoleh dari ResultFilterAttribute)
StatusCode

Mendapatkan kode status HTTP respons.

Type

Mendapatkan jenis tindakan pengembalian optimis.

Metode

OnResultExecuted(ResultExecutedContext)

Dipanggil setelah hasil tindakan dijalankan.

OnResultExecuted(ResultExecutedContext)

Dipanggil setelah hasil tindakan dijalankan.

(Diperoleh dari ResultFilterAttribute)
OnResultExecuting(ResultExecutingContext)

Dipanggil sebelum hasil tindakan dijalankan.

OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate)

Dipanggil secara asinkron sebelum hasil tindakan.

(Diperoleh dari ResultFilterAttribute)
SetContentTypes(MediaTypeCollection)

Mengonfigurasi kumpulan tipe konten yang diizinkan yang dapat dihasilkan oleh tindakan.

Berlaku untuk