title: ReferenceLoopHandling.Ignore not working in WebApi Global.asax
body: <p>I have an API end point which is returning a loop error (as it links a joining class which loops back) so e.g.</p>
  
  <pre><code>class A
  {
       virtual ClassAB;
  }
  
  class B
  {
       virtual ClassAB;
  }
  
  class AB
  {
       virtual ClassA;
       virtual ClassB;
  }    
  </code></pre>
  
  <p>In an API GET I need to return details of ClassB from the perspective of ClassA (and vice versa in a ClassB GET).</p>
  
  <p>When I get I do the following:</p>
  
  <pre><code>IQueryable&lt;ClassA&gt; results = _dbset
      .Include(x =&gt; x.ClassAB)
      .Include(x =&gt; x.ClassAB.Select(y =&gt; y.ClassB))
      .AsExpandable()
      .Where(predicate)
      .OrderBy(x =&gt; x.ID);
  </code></pre>
  
  <p>So I get the self ref looping error. Now in my DB Context I have:</p>
  
  <pre><code>Configuration.ProxyCreationEnabled = false;
  Configuration.LazyLoadingEnabled = false;
  </code></pre>
  
  <p>and in my <code>Global.asax</code> <code>protected void Application_Start()</code> I have:</p>
  
  <pre><code>GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore;
  </code></pre>
  
  <p>However, I am still getting the error; any ideas how to resolve the issue?</p>