It helped me, thanks Darin. However, context.RouteData.Values ββdid not have an area for me, but context.RouteData.DataTokens ["area"] did! also in my case, I had a controller that was not in certain areas (e.g. shared controllers), so I had to check that the data area was zero. This is what worked for me:
kernel .BindFilter<TestLoggingAttribute>(FilterScope.Controller, 0) .When((context, ad) => context.RouteData.DataTokens["area"] != null && context.RouteData.DataTokens["area"] == "Organization");
source share