Created
October 25, 2013 07:47
-
-
Save nunofilipecosta/7150918 to your computer and use it in GitHub Desktop.
ModelState to String Array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var errorInModelState = this.ModelState.Keys.SelectMany(key => this.ModelState[key].Errors).Select(k => k.ErrorMessage); | |
return Request.CreateResponse(HttpStatusCode.BadRequest, errorInModelState); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment