title: c# deriving from a base apicontroller - in the base class the Request object is null
body: <p>I have a few api controllers with similar behavior. I've created a common base class which itself is an api controller. In my derived classes I have some assumptions that should be resolved in the base api controller (for instance some common header values). But my problem is in the base ApiController the "Request" object is null!</p>
  
  <p>Why is this and how can I solve? (It is important in the construction of the derived class as I am assigning values based on header values)</p>
  
  <p>A Code example</p>
  
  <pre><code>BaseClass : ApiController
  {
  public BaseClass()
  {
    _header1 =  Request.Headers.GetValues("header1");
  }
  }
  
  DerivedClass : BaseClass
  {
  // getting error here because the base class isn't constructed because the Request object is null! and errors are thrown
  }
  </code></pre>