Skip to content

Instantly share code, notes, and snippets.

@mirsaeedi
Created January 19, 2021 01:26
Show Gist options
  • Save mirsaeedi/94f26ec1c22024cd0158a1bfe69f9938 to your computer and use it in GitHub Desktop.
Save mirsaeedi/94f26ec1c22024cd0158a1bfe69f9938 to your computer and use it in GitHub Desktop.
Check If Request Is Valid
public async Task<ActionResult> GetExample([FromBody] ExampleRequest request)
{
if (!ModelState.IsValid)
{
// return the customized error
}
// Handle the request
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment