We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A global filter is not executing when a controller contains a controller level filter.
Tried with ninject 2.3.0.6 and 2.2.1.1
To reproduce
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = true, AllowMultiple = true)] public class AlphaAttribute : Attribute {} public class FilterAlpha : IActionFilter { public void OnActionExecuting(ActionExecutingContext filterContext) {} public void OnActionExecuted(ActionExecutedContext filterContext) { filterContext.Controller.ViewData["alpha"] = "here"; } } public class FilterBeta : IActionFilter { public void OnActionExecuting(ActionExecutingContext filterContext) {} public void OnActionExecuted(ActionExecutedContext filterContext) { filterContext.Controller.ViewData["beta"] = "here"; } } [Alpha] public class WithController : Controller { public ActionResult Index() { return View(); } } public class WithoutController : Controller { public ActionResult Index() { return View(); } }
Registration
kernel.BindFilter<FilterAlpha>(FilterScope.Controller, 0) .WhenControllerHas<AlphaAttribute>(); kernel.BindFilter<FilterBeta>(FilterScope.Global, 0);
Views
<p>Alpha? @ViewData["alpha"]</p> <p>Beta? @ViewData["beta"]</p>
Example project can be found here
The text was updated successfully, but these errors were encountered:
Replaced by ninject/Ninject#36
Sorry, something went wrong.
No branches or pull requests
A global filter is not executing when a controller contains a controller level filter.
Tried with ninject 2.3.0.6 and 2.2.1.1
To reproduce
Registration
Views
Example project can be found here
The text was updated successfully, but these errors were encountered: