IOrderedFilter.Order 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得決定篩選準則執行順序的順序值。 篩選會以屬性的 Order 遞增數值執行。
public:
property int Order { int get(); };
public int Order { get; }
member this.Order : int
Public ReadOnly Property Order As Integer
屬性值
備註
篩選會依屬性的 Order 遞增排序來執行。
非同步篩選,例如 IAsyncActionFilter ,會圍繞相同篩選類型後續篩選的執行。 具有較低數值 Order 的非同步篩選會有其篩選方法,例如 OnActionExecutionAsync(ActionExecutingContext, ActionExecutionDelegate) ,在具有較高值 Order 的篩選準則之前執行。
同步篩選 IActionFilter 條件,例如 ,具有 before-method,例如 OnActionExecuting(ActionExecutingContext) 和 after-method,例如 OnActionExecuted(ActionExecutedContext) 。 具有較低數值 Order 的同步篩選,會在具有較高值的 Order 篩選之前執行其 before-method。 在篩選準則的後階段期間,具有較低數值 Order 的同步篩選會在具有較高值的 Order 篩選之後執行其 after-method。
如果兩個篩選準則的數值 Order 相同,則其相對執行順序是由篩選範圍決定。