ProducesDefaultResponseTypeAttribute 类

定义

一个筛选器,该筛选器指定 Type 未涵盖的所有 HTTP 状态代码的 ProducesResponseTypeAttribute

public ref class ProducesDefaultResponseTypeAttribute sealed : Attribute, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiDefaultResponseMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IFilterMetadata
[System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public sealed class ProducesDefaultResponseTypeAttribute : Attribute, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDefaultResponseMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IFilterMetadata
[<System.AttributeUsage(System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ProducesDefaultResponseTypeAttribute = class
    inherit Attribute
    interface IApiDefaultResponseMetadataProvider
    interface IApiResponseMetadataProvider
    interface IFilterMetadata
Public NotInheritable Class ProducesDefaultResponseTypeAttribute
Inherits Attribute
Implements IApiDefaultResponseMetadataProvider, IFilterMetadata
继承
ProducesDefaultResponseTypeAttribute
属性
实现

构造函数

ProducesDefaultResponseTypeAttribute()

初始化 ProducesResponseTypeAttribute 的实例。

ProducesDefaultResponseTypeAttribute(Type)

初始化 ProducesResponseTypeAttribute 的实例。

属性

StatusCode

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

Type

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

显式接口实现

IApiResponseMetadataProvider.SetContentTypes(MediaTypeCollection)

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

适用于