title: WebAPI: Retrieve GET parameter from Controller Constructor
body: <p>Every call to my WebAPI may (or may not) contain the GET parameter </p>
  
  <pre><code>/api/SomeControllerFunction?loglevel=(someint)
  </code></pre>
  
  <p>From the function inside the controller I can initialize a LogCollector:</p>
  
  <pre><code>[HttpGet] 
  SomeControllerFunction(int loglevel = 0)
  {
      LogCollector logger = new LogCollector(loglevel)
  }
  </code></pre>
  
  <p>To not repeat myself too often, I want to hide this in the class hierarchy by adding it into the constructor of a BaseController, from which all my controllers shall inherit:</p>
  
  <pre><code>public class BaseController: ApiController
  {
      internal LogCollector Logger
      BaseController()
      {
          Logger = new LogCollector(loglevel);
      }
  </code></pre>
  
  <p>But how can I access a GET parameter from the constructor?</p>