title: How to perform async ModelState validation with FluentValidation in Web API?
body: <p>I setup a web api project to use FluentValidation using the <a href="https://www.nuget.org/packages/FluentValidation.WebApi/" rel="noreferrer">webapi integration package</a> for FluentValidation. Then I created a validator that uses <code>CustomAsync(...)</code> to run queries against the database.</p>
  
  <p>The issue is that the validation seems to deadlock when awaiting for the database task. I did some investigation, it seems that the MVC ModelState API is synchronous, and it calls a synchronous <code>Validate(...)</code> method that makes FluentValidation to call <code>task.Result</code>, causing the deadlock.</p>
  
  <p>Is it correct to assume that async calls won't work well with webapi integrated validation?</p>
  
  <p>And if that is the case, what is the alternative? WebApi ActionFilters seem to support for async processing. Do I need to build my own filter to handle the validation manually or is there something already there to do that that I'm not seeing?</p>