autofac / Autofac.WebApi

ASP.NET Web API integration for Autofac
Other
36 stars 27 forks source link

Filters provided via dependency injection are called in the same order pre- & post-action #16

Closed richarddbarnett closed 8 years ago

richarddbarnett commented 8 years ago

If 2 filters A & B are provided for a controller via depedency injection & OnActionExecuting is called for filter A & then filter B, then OnActionExecuted is called for A & then B.

If the same filters are added to HttpConfiguration.Filters then OnActionExecuted is called for B & then A, which I think is the correct order.

Observed using Autofac 3.5.2, Autofac.WebApi2 3.4.0.

richarddbarnett commented 8 years ago

This also affects the 4.x branch.

tillig commented 8 years ago

Verified. We need to run that in the reverse order on action executed. Great catch! Thanks!

tillig commented 8 years ago

This is fixed in v4.0.2-CI-234 on the MyGet feed and will be available in the next push to NuGet.