Bagikan melalui


ProducesResponseTypeAttribute Kelas

Definisi

Filter yang menentukan jenis nilai dan kode status yang dikembalikan oleh tindakan.

public ref class ProducesResponseTypeAttribute : Attribute, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiResponseMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class ProducesResponseTypeAttribute : Attribute, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type ProducesResponseTypeAttribute = class
    inherit Attribute
    interface IApiResponseMetadataProvider
    interface IFilterMetadata
Public Class ProducesResponseTypeAttribute
Inherits Attribute
Implements IApiResponseMetadataProvider, IFilterMetadata
Warisan
ProducesResponseTypeAttribute
Turunan
Atribut
Penerapan

Konstruktor

ProducesResponseTypeAttribute(Int32)

Menginisialisasi instans ProducesResponseTypeAttribute.

ProducesResponseTypeAttribute(Type, Int32)

Menginisialisasi instans ProducesResponseTypeAttribute.

ProducesResponseTypeAttribute(Type, Int32, String, String[])

Menginisialisasi instans ProducesResponseTypeAttribute.

Properti

StatusCode

Mendapatkan atau mengatur kode status HTTP respons.

Type

Mendapatkan atau mengatur jenis nilai yang dikembalikan oleh tindakan.

Implementasi Antarmuka Eksplisit

IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection)

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

Berlaku untuk