I have error messages that appear in the following format:
{
"message":"The request is invalid.",
"modelState":{
"model.ConfirmPassword":["The password and confirmation password do not match."]
}
}
{
"message":"The request is invalid.",
"modelState":{
"model.Email":["The Email must be at least 10 characters long."],
"model.ConfirmPassword":["The password and confirmation password do not match."]
}
}
I know how to get the modelState but how can I get the first message field in the modelState when that field could be different each time?
- What I would like in the first instance is to get the message: "The password and confirmation password do not match."
- And in the second instance the message: "The Email must be at least 10 characters long."