ProducesAttribute 类 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
一个筛选器,指定操作将返回的预期 Type 以及支持的响应内容类型。 值 ContentTypes 用于设置 ContentTypes。
public ref class ProducesAttribute : Microsoft::AspNetCore::Mvc::Filters::ResultFilterAttribute, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiResponseMetadataProviderpublic 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 IResultFilterPublic Class ProducesAttribute
Inherits ResultFilterAttribute
Implements IApiResponseMetadataProviderPublic Class ProducesAttribute
Inherits Attribute
Implements IApiResponseMetadataProvider, IOrderedFilter, IResultFilter- 继承
- 继承
- 
				ProducesAttribute
- 派生
- 属性
- 实现
构造函数
| ProducesAttribute(String, String[]) | 使用允许的内容类型初始化 的 ProducesAttribute 实例。 | 
| ProducesAttribute(Type) | 初始化 ProducesAttribute 的实例。 | 
属性
| ContentTypes | 获取或设置支持的响应内容类型。 用于设置 ContentTypes。 | 
| Order | 获取用于确定筛选器执行顺序的顺序值。 筛选器以 属性的 Order 升序数值执行。 | 
| Order | 获取用于确定筛选器执行顺序的顺序值。 筛选器以 属性的 Order 升序数值执行。(继承自 ResultFilterAttribute) | 
| StatusCode | 获取响应的 HTTP 状态代码。 | 
| Type | 获取操作的乐观返回类型。 | 
方法
| OnResultExecuted(ResultExecutedContext) | 在操作结果执行之后调用。 | 
| OnResultExecuted(ResultExecutedContext) | 在操作结果执行之后调用。(继承自 ResultFilterAttribute) | 
| OnResultExecuting(ResultExecutingContext) | 在操作结果执行之前调用。 | 
| OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate) | 在操作结果之前异步调用。(继承自 ResultFilterAttribute) | 
| SetContentTypes(MediaTypeCollection) | 配置可由 操作生成的允许内容类型的集合。 |