Problems with Model binding and validation attributes with asp.net Web API
I am writing a Web API with ASP.NET Web API, and make use of the following View Model. I seem to be having a problem with the data binding when there are two validation attributes on a particular property (i.e. [Required] and [StringLength(10)]). When posting a JSON value from a client to a controller action of the form: // POST api/list public void Post([FromBody] TaskViewModel taskVM) I observe the following: If I remove one of the multiple attributes everything is bound OK; If I leave in the multiple attributes, the client recieves a 500 internal server error and the body of the Post method