Setup filter attribute for dependency injection to accept params in constructor
问题 I'm following a ninject filter attribute setup on this page. For them, they have: .WithConstructorArgumentFromControllerAttribute<LogAttribute>( "logLevel", attribute => attribute.LogLevel); The second parameter is expecting a Func<LogAttribute, object> callback . Their actual param list is setup as follows: Log(LogLevel = Level.Debug) But my filter attribute is setup as follows: public class AuthAttribute : FilterAttribute { } public class AuthFilter : IAuthorizationFilter { private readonly