title: Custom filter attributes inject dependency
body: <p>I'musing ASP.NET Web API and I need to have authorization so I've created custom authorization attribute </p>
  
  <pre><code>public class CustomAuthorizationAttribute : AuthorizeAttribute
  </code></pre>
  
  <p>In order to inject dependency inside constructor I have following :</p>
  
  <pre><code>        public CustomAuthorizationAttribute(IAccountBL accountBl)
      {
          _accountBL = accountBl;
      }
  </code></pre>
  
  <p>In <code>IAccountBL</code> I have method which interacts with database checking if user is authorized to make request. 
  Inside Member API controller I've register that attribute </p>
  
  <pre><code>    [CustomAuthorization]
  public class MemberController : ApiController
  </code></pre>
  
  <p>But I get following error </p>
  
  <blockquote>
    <p>Project.Account.AccountBL' does not contain a constructor that takes 0 arguments</p>
  </blockquote>
  
  <p>And if I register it like </p>
  
  <pre><code>[CustomAuthorization(IAccountBL)]
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/XJDe2.png" alt="enter image description here"></p>
  
  <p>Thank you</p>