Skip to content

Commit 7a48724

Browse files
authored
Fixes filter order (#20073)
* fix url * fix order
1 parent 99a534c commit 7a48724

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

aspnetcore/mvc/controllers/filters.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ The `TestController`:
205205

206206
<!-- test via webBuilder.UseStartup<Startup>(); -->
207207

208-
Navigating to `https://localhost:5001/Test2/FilterTest2` runs the following code:
208+
Navigating to `https://localhost:5001/Test/FilterTest2` runs the following code:
209209

210210
* `TestController.OnActionExecuting`
211211
* `MySampleActionFilter.OnActionExecuting`
@@ -244,8 +244,8 @@ The 3 filters run in the following order:
244244
* `MySampleActionFilter.OnActionExecuting`
245245
* `MyAction2FilterAttribute.OnActionExecuting`
246246
* `Test2Controller.FilterTest2`
247-
* `MySampleActionFilter.OnActionExecuted`
248-
* `MyAction2FilterAttribute.OnResultExecuting`
247+
* `MyAction2FilterAttribute.OnResultExecuting`
248+
* `MySampleActionFilter.OnActionExecuted`
249249
* `Test2Controller.OnActionExecuted`
250250

251251
The `Order` property overrides scope when determining the order in which filters run. Filters are sorted first by order, then scope is used to break ties. All of the built-in filters implement `IOrderedFilter` and set the default `Order` value to 0. As mentioned previously, controller level filters set the [Order](https://github.com/dotnet/AspNetCore/blob/master/src/Mvc/Mvc.Core/src/Filters/ControllerActionFilter.cs#L15-L17) property to `int.MinValue` For built-in filters, scope determines order unless `Order` is set to a non-zero value.

0 commit comments

Comments
 (0)