ConsumesAttribute Sınıf

Tanım

Desteklenen istek içerik türlerini belirten bir filtre. ContentTypes , başka türlü birden çok eşleşme olduğunda bir eylemi seçmek için kullanılır.

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
Devralma
ConsumesAttribute
Öznitelikler
Uygulamalar

Oluşturucular

ConsumesAttribute(String, String[])

ConsumesAttribute öğesinin yeni bir örneğini oluşturur.

ConsumesAttribute(Type, String, String[])

ConsumesAttribute öğesinin yeni bir örneğini oluşturur.

Alanlar

ConsumesActionConstraintOrder

consumes özniteliğinin sırası.

Özellikler

ContentTypes

Desteklenen istek içerik türlerini alır veya ayarlar. Başka türlü birden çok eşleşme olduğunda bir eylem seçmek için kullanılır.

IsOptional

İstek gövdesinin isteğe bağlı olup olmadığını belirleyen bir değer alır veya ayarlar. Bu değer yalnızca API gezgininde istek gövdesinin gerekli olup olmadığını belirtmek için kullanılır.

Yöntemler

Accept(ActionConstraintContext)

Eylemin seçim için geçerli bir aday olup olmadığını belirler.

OnResourceExecuted(ResourceExecutedContext)

Kaynak filtresini yürütür. İşlem hattının geri kalanı yürütüldikten sonra çağrılır.

OnResourceExecuting(ResourceExecutingContext)

Kaynak filtresini yürütür. İşlem hattının geri kalanı yürütülmeden önce çağrılır.

SetContentTypes(MediaTypeCollection)

Eylem tarafından gerçekleştirilen izin verilen içerik türlerinden oluşan bir koleksiyon yapılandırılır.

Belirtik Arabirim Kullanımları

IAcceptsMetadata.ContentTypes

Desteklenen istek içerik türlerini belirten bir filtre. ContentTypes , başka türlü birden çok eşleşme olduğunda bir eylemi seçmek için kullanılır.

IAcceptsMetadata.RequestType

Desteklenen istek içerik türlerini belirten bir filtre. ContentTypes , başka türlü birden çok eşleşme olduğunda bir eylemi seçmek için kullanılır.

IActionConstraint.Order

Kısıtlama sırası.

Şunlara uygulanır