AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

Conflicting information on the IOrderedFilter order value

Open metoule opened this issue 4 months ago • 1 comments

Description

In the section Override the default order, it's impossible to know the order in which the filters are executed:

A filter with a lower Order value:

  • Runs the before code before that of a filter with a higher value of Order.
  • Runs the after code after that of a filter with a higher Order value.

It's unclear if the filters are executed in increasing Order (ie. -1, 0, 1) or decreasing order (ie. 1, 0, -1).

It's also unclear what happens when two filters have the same Order value.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/mvc/controllers/filters?view=aspnetcore-9.0#override-the-default-order

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/mvc/controllers/filters.md

Document ID

ebb299e0-6c1c-7077-689d-ac711352e418

Platform Id

5fd5f8db-4027-09c2-d61e-c2eda855d8fc

Article author

@tdykstra

Metadata

  • ID: a70a955f-dd5a-c46b-dfe8-21521e619320
  • PlatformId: 5fd5f8db-4027-09c2-d61e-c2eda855d8fc
  • Service: aspnet-core
  • Sub-service: mvc

Related Issues


Associated WorkItem - 498817

metoule avatar Sep 23 '25 07:09 metoule

Oops I didn't understand that the before code represents OnResultExecutionAsync and the after code represents OnResultExecuted 🙈

metoule avatar Sep 23 '25 07:09 metoule