ConsumesAttribute クラス

定義

サポートされている要求コンテンツ タイプを指定するフィルター。 ContentTypes は、それ以外の場合は複数の一致がある場合にアクションを選択するために使用されます。

public ref class ConsumesAttribute : Attribute, Microsoft::AspNetCore::Mvc::ActionConstraints::IActionConstraint, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiRequestMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IResourceFilter, Microsoft::AspNetCore::Mvc::Internal::IConsumesActionConstraint
public ref class ConsumesAttribute : Attribute, Microsoft::AspNetCore::Mvc::ActionConstraints::IActionConstraint, Microsoft::AspNetCore::Mvc::ApiExplorer::IApiRequestMetadataProvider, Microsoft::AspNetCore::Mvc::Filters::IResourceFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class ConsumesAttribute : Attribute, Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraint, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IResourceFilter, Microsoft.AspNetCore.Mvc.Internal.IConsumesActionConstraint
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class ConsumesAttribute : Attribute, Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraint, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IResourceFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)]
public class ConsumesAttribute : Attribute, Microsoft.AspNetCore.Http.Metadata.IAcceptsMetadata, Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraint, Microsoft.AspNetCore.Mvc.ApiExplorer.IApiRequestMetadataProvider, Microsoft.AspNetCore.Mvc.Filters.IResourceFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ConsumesAttribute = class
    inherit Attribute
    interface IResourceFilter
    interface IFilterMetadata
    interface IConsumesActionConstraint
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ConsumesAttribute = class
    inherit Attribute
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
    interface IFilterMetadata
    interface IResourceFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ConsumesAttribute = class
    inherit Attribute
    interface IResourceFilter
    interface IFilterMetadata
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=false, Inherited=true)>]
type ConsumesAttribute = class
    inherit Attribute
    interface IResourceFilter
    interface IFilterMetadata
    interface IActionConstraint
    interface IActionConstraintMetadata
    interface IApiRequestMetadataProvider
    interface IAcceptsMetadata
Public Class ConsumesAttribute
Inherits Attribute
Implements IActionConstraint, IApiRequestMetadataProvider, IConsumesActionConstraint, IResourceFilter
Public Class ConsumesAttribute
Inherits Attribute
Implements IActionConstraint, IApiRequestMetadataProvider, IResourceFilter
Public Class ConsumesAttribute
Inherits Attribute
Implements IAcceptsMetadata, IActionConstraint, IApiRequestMetadataProvider, IResourceFilter
継承
ConsumesAttribute
属性
実装

コンストラクター

ConsumesAttribute(String, String[])

ConsumesAttribute の新しいインスタンスを作成します。

ConsumesAttribute(Type, String, String[])

ConsumesAttribute の新しいインスタンスを作成します。

フィールド

ConsumesActionConstraintOrder

の順序は 属性を使用します。

プロパティ

ContentTypes

サポートされている要求コンテンツ タイプを取得または設定します。 それ以外の場合は複数の一致がある場合にアクションを選択するために使用されます。

IsOptional

要求本文が省略可能かどうかを決定する値を取得または設定します。 この値は、API エクスプローラーで要求本文が必要かどうかを指定するためにのみ使用されます。

メソッド

Accept(ActionConstraintContext)

アクションが選択の有効な候補であるかどうかを判断します。

OnResourceExecuted(ResourceExecutedContext)

リソース フィルターを実行します。 パイプラインの残りの部分の実行後に呼び出されます。

OnResourceExecuting(ResourceExecutingContext)

リソース フィルターを実行します。 パイプラインの残りの部分の実行前に呼び出されます。

SetContentTypes(MediaTypeCollection)

アクションで使用できる許可コンテンツ タイプのコレクションを構成します。

明示的なインターフェイスの実装

IAcceptsMetadata.ContentTypes

サポートされている要求コンテンツ タイプを指定するフィルター。 ContentTypes は、それ以外の場合は複数の一致がある場合にアクションを選択するために使用されます。

IAcceptsMetadata.RequestType

サポートされている要求コンテンツ タイプを指定するフィルター。 ContentTypes は、それ以外の場合は複数の一致がある場合にアクションを選択するために使用されます。

IActionConstraint.Order

制約の順序。

適用対象