ExceptionFilterAttribute Sınıf

Tanım

Bir eylem oluşturulduktan sonra zaman uyumsuz olarak çalışan soyut bir Exceptionfiltre. Alt sınıfların her ikisini de geçersiz kılmalıdır veya OnExceptionAsync(ExceptionContext) geçersiz kılmamalıdırOnException(ExceptionContext).

public ref class ExceptionFilterAttribute abstract : Attribute, Microsoft::AspNetCore::Mvc::Filters::IAsyncExceptionFilter, Microsoft::AspNetCore::Mvc::Filters::IExceptionFilter, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public abstract class ExceptionFilterAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IAsyncExceptionFilter, Microsoft.AspNetCore.Mvc.Filters.IExceptionFilter, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type ExceptionFilterAttribute = class
    inherit Attribute
    interface IAsyncExceptionFilter
    interface IFilterMetadata
    interface IExceptionFilter
    interface IOrderedFilter
Public MustInherit Class ExceptionFilterAttribute
Inherits Attribute
Implements IAsyncExceptionFilter, IExceptionFilter, IOrderedFilter
Devralma
ExceptionFilterAttribute
Öznitelikler
Uygulamalar

Oluşturucular

ExceptionFilterAttribute()

Bir eylem oluşturulduktan sonra zaman uyumsuz olarak çalışan soyut bir Exceptionfiltre. Alt sınıfların her ikisini de geçersiz kılmalıdır veya OnExceptionAsync(ExceptionContext) geçersiz kılmamalıdırOnException(ExceptionContext).

Özellikler

Order

Filtrelerin yürütülmesinin sırasını belirlemek için sipariş değerini alır. Filtreler özelliğin artan sayısal değerinde Order yürütülür.

Yöntemler

OnException(ExceptionContext)

Eylem oluşturulduktan sonra çağrılır Exception.

OnExceptionAsync(ExceptionContext)

Eylem oluşturulduktan sonra çağrılır Exception.

Şunlara uygulanır