Created
January 19, 2021 01:26
-
-
Save mirsaeedi/94f26ec1c22024cd0158a1bfe69f9938 to your computer and use it in GitHub Desktop.
Check If Request Is Valid
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
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