ProducesResponseTypeAttribute 类

定义

一个筛选器,指定操作返回的值和状态代码的类型。

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
继承
ProducesResponseTypeAttribute
派生
属性
实现

构造函数

ProducesResponseTypeAttribute(Int32)

初始化 ProducesResponseTypeAttribute 的实例。

ProducesResponseTypeAttribute(Type, Int32)

初始化 ProducesResponseTypeAttribute 的实例。

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

初始化 ProducesResponseTypeAttribute 的实例。

属性

StatusCode

获取或设置响应的 HTTP 状态代码。

Type

获取或设置操作返回的值的类型。

显式接口实现

IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection)

配置可由操作生成的允许内容类型的集合。

适用于