title: Custom MediaTypeFormatter (Serializer) for ApiController specific method
body: <p>I have <code>ApiController</code> in place and one of methods needs have custom serialization.</p>
  
  <pre><code>    public async Task&lt;Session&gt; PostSession([FromBody] Session session)
  </code></pre>
  
  <p>There is massive Session object that holds everything and consumer does not want do get more than half of it, normally I could just decorate properties with <code>[XmlIgnore()]</code> and be done, however this object is being passed internally across many APIs and removing these would break these mechanisms. </p>
  
  <p>Another solution would be to just replace that object with different one like <code>CastratedSession</code> and return that. I can't do this since same endpoint is being called by existing 3rd party APIs that expect to get <code>Session</code> or they would have to rewrite their stuff (not going to happen). </p>
  
  <p>I then proposed to create a different endpoint that this 3rd party could call - but architect objected and said to do the custom <code>MediaTypeFormatter</code> based on specific <code>content-type</code> value they will set in header, problem is we already are using in this same controller custom <code>MediaTypeFormatter</code>, and the way I understand out of the box one can only set them in configuration per controller</p>
  
  <pre><code>public static void ConfigureApis(HttpConfiguration config)
  {
      config.Formatters.Add(new CustomJsonFormatter()); 
      config.Formatters.Add(new CustomXmlFormatter()); 
  }
  </code></pre>
  
  <p>Which sorta paints me into the corner.</p>
  
  <p><strong>How (Can) I setup a custom <code>MediaTypeFormatter</code> per method on ApiController?</strong></p>