c# - Why does BadRequest(ModelState) return Status Code 500? -


i have web api controller turning return badrequest(modelstate) if fails modelsatate.isvalid check so.

if(modelstate.isvalid) {     return badrequest(modelstate); } 

but why response code 500 , not 400? if return badrequest() without modelstate, 400.

if(modelstate.isvalid) {     return badrequest(); } 


Popular posts from this blog

node.js - How do I prevent MongoDB replica set from querying the primary? -

c# - Randomly pick a specific int from a 2D Array -

php - Angularjs http.delete is not working after deploying project on server -