title: Is it good practice to inherit from ControllerBase in Web API .NET Core 2.2?
body: <p>I'm creating a webapi and I wanted to create a controller that inherits from a ControllerBase class.</p>
  
  <p>I'm doing this because I need to do some stuff before calling the action i.e check for the user registration and use the HttpContext.</p>
  
  <pre><code>public class BaseApiZrController : ControllerBase
  {
      public BaseApiZrController(ApplicationDbContext db)
      {
  
          this.HandleAuthentication();
  
          //??? this.HttpContext is always null, how come?
          ClaimsPrincipal claimsPrincipal = this.HttpContext.User;
  
      }
      //...some code
  
   }
  </code></pre>
  
  <p>Is this a good practice or should I be doing all this in the start class through the middleware?</p>
  
  <p>The other question, when inheriting the ControllerBase class into my custom BaseApiZrController class, I can't accesss the httpContext, it always returns null, how come?</p>