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.

public 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 : Attribute, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiResponseMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter, Microsoft.AspNetCore.Mvc.Filters.IResultFilter
type ProducesAttribute = class
    inherit Attribute
    interface IApiResponseMetadataProvider
    interface IFilterMetadata
    interface IOrderedFilter
    interface IResultFilter
Public Class ProducesAttribute
Inherits Attribute
Implements IApiResponseMetadataProvider, IOrderedFilter, IResultFilter
Inheritance
ProducesAttribute
Attributes
Implements

Constructors

ProducesAttribute(String, String[])

Initializes an instance of ProducesAttribute with allowed content types.

ProducesAttribute(Type)

Initializes an instance of ProducesAttribute.

Properties

ContentTypes

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

Order
StatusCode
Type

Methods

OnResultExecuted(ResultExecutedContext)
OnResultExecuting(ResultExecutingContext)
OnResultExecutionAsync(ResultExecutingContext, ResultExecutionDelegate) (Inherited from ResultFilterAttribute)
SetContentTypes(MediaTypeCollection)

Applies to