ProducesAttribute ProducesAttribute ProducesAttribute Class

Definition

A filter that specifies the expected Type the action will return and the supported response content types. The ContentTypes value is used to set ContentTypes.

[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
type ProducesAttribute = class
    inherit Attribute
    interface IResultFilter
    interface IFilterMetadata
    interface IOrderedFilter
    interface IApiResponseMetadataProvider
Public Class ProducesAttribute
Inherits Attribute
Implements IApiResponseMetadataProvider, IOrderedFilter, IResultFilter
Inheritance
ProducesAttributeProducesAttributeProducesAttribute
Attributes
Implements

Constructors

ProducesAttribute(Type) ProducesAttribute(Type) ProducesAttribute(Type)

Initializes an instance of ProducesAttribute.

ProducesAttribute(String, String[]) ProducesAttribute(String, String[]) ProducesAttribute(String, String[])

Initializes an instance of ProducesAttribute with allowed content types.

Properties

ContentTypes ContentTypes ContentTypes

Gets or sets the supported response content types. Used to set ContentTypes.

Order Order Order
StatusCode StatusCode StatusCode
Type Type Type

Methods

OnResultExecuted(ResultExecutedContext) OnResultExecuted(ResultExecutedContext) OnResultExecuted(ResultExecutedContext)
OnResultExecuting(ResultExecutingContext) OnResultExecuting(ResultExecutingContext) OnResultExecuting(ResultExecutingContext)
SetContentTypes(MediaTypeCollection) SetContentTypes(MediaTypeCollection) SetContentTypes(MediaTypeCollection)

Applies to