title: Manually validate Model in Web api controller
body: <p>I have a class called 'User' and a property 'Name'</p>
  
  <pre><code>public class User
  {
      [Required]
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>And api controller method is</p>
  
  <pre><code>public IHttpActionResult PostUser()
  {
  
         User u = new User();
         u.Name = null;
  
          if (!ModelState.IsValid)
          return BadRequest(ModelState);
  
          return Ok(u);
  }
  </code></pre>
  
  <p>How do i manually validate the User object so the ModelState.IsValid return false to me?</p>