title: .NET Core Action Filter is not a an attribute class
body: <p>I have this action filter that I want to call, I have already declared it in Startup.cs. However, when I call it above my class, I get this error: </p>
  
  <blockquote>
    <p>LogUserNameFilter is not an attribute class</p>
  </blockquote>
  
  <p>I'm not sure what I'm missing.</p>
  
  <pre><code>public class LogUserNameFilter : IActionFilter
  {
      private readonly RequestDelegate next;
  
      public LogUserNameFilter(RequestDelegate next)
      {
          this.next = next;
      }
  
      public void OnActionExecuted(ActionExecutedContext context)
      {
          throw new NotImplementedException();
      }
  
      public void OnActionExecuting(ActionExecutingContext context)
      {
          LogContext.PushProperty("UserName", context.HttpContext.User.Identity.Name);
      }
  }
  </code></pre>
  
  <p>Startup.cs</p>
  
  <pre><code>services.AddScoped&lt;LogUserNameFilter&gt;();
  </code></pre>
  
  <p>Class declaration</p>
  
  <pre><code>[LogUserNameFilter]
  public class HomeController : Controller{
  
  
  }
  </code></pre>