語言

ServiceFilterAttribute 類別

定義

在 中尋找另一個篩選準則的 IServiceProvider 篩選。

public ref class ServiceFilterAttribute : Attribute, Microsoft::AspNetCore::Mvc::Filters::IFilterFactory, Microsoft::AspNetCore::Mvc::Filters::IOrderedFilter
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)]
public class ServiceFilterAttribute : Attribute, Microsoft.AspNetCore.Mvc.Filters.IFilterFactory, Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true, Inherited=true)>]
type ServiceFilterAttribute = class
    inherit Attribute
    interface IFilterFactory
    interface IFilterMetadata
    interface IOrderedFilter
Public Class ServiceFilterAttribute
Inherits Attribute
Implements IFilterFactory, IOrderedFilter
繼承
ServiceFilterAttribute
衍生
屬性
實作

備註

主要用於 FilterCollection.AddService 呼叫中。

TypeFilterAttribute類似于 ,這兩者都使用建構函式插入。 如果篩選不是服務本身,請改用 TypeFilterAttribute 。

建構函式

名稱 Description
ServiceFilterAttribute(Type)

具現化新的 ServiceFilterAttribute 實例。

屬性

名稱 Description
IsReusable

取得值,這個值表示 是否可在要求之間重複使用 的結果 CreateInstance(IServiceProvider) 。

Order

取得決定篩選準則執行順序的順序值。 篩選會以屬性的 Order 遞增數值執行。

ServiceType

Type取得要尋找之篩選的 。

方法

名稱 Description
CreateInstance(IServiceProvider)

建立可執行檔篩選的實例。

適用於