title: Web Api ResponseType of System.Web.Http.Results
body: <p>I have a .Net Web Api application, and one of the Actions has an output of <code>Task&lt;IHttpActionResult&gt;</code>. </p>
  
  <p>The action's response can be either be - <code>System.Web.Http.Results.BadRequestResult</code> or <code>System.Web.Http.Results.OkResult</code>. </p>
  
  <p>I want to put an appropriate type inside the <code>typeof()</code> in the attribute <code>[ResponseType(typeof())]</code> to indicate what the action returns. </p>
  
  <p>What should go inside the parenthesis of the <code>typeof()</code>?</p>
  
  <p>Here is what my code currently looks like in my Controller - </p>
  
  <pre><code>    [HttpPut]
      [ResponseType(typeof (*NEED SOMETHING HERE*))]
      public async Task&lt;IHttpActionResult&gt; PutAsync(MyClass myClass)
      {
          var success =  await _myRepository.TrySomething(myClass);
          if (!success)
          {
              return BadRequest();
          }
  
          return Ok();
      }
  </code></pre>