title: How to serialise Web API 2 HttpRequestMessage into my custom object
body: <p>I have the following method in my WebAPI 2 project.</p>
  
  <pre><code>public class TestController : ApiController
  {
      [HttpPost]
      public void Test(HttpRequestMessage request)
      {
          var content = request.Content;
          string jsonContent = content.ReadAsStringAsync().Result;
      }
  }
  </code></pre>
  
  <p>My custom object looks like this;</p>
  
  <pre><code>public class Test
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>If I post some sample data like</p>
  
  <pre><code>&lt;Test&gt;
      &lt;Id&gt;12345&lt;/Id&gt;
      &lt;Name&gt;My Name&lt;/Name&gt;
  &lt;/Test&gt;
  </code></pre>
  
  <p>The resulting value in jsonContent is correct.  My question is how best should I serialise the HttpRequestMessage (content) into my object Test so that I can perform additional validation / tasks etc.</p>
  
  <p>Should I pass HttpRequestMessage  into the method or is it possible to pass something like</p>
  
  <pre><code>public void Test(Test oTest)
  </code></pre>