In the below code i am getting an exception because "isValid" is coming as null from the input request.
I want to set "isValid" to "False" when it was null from the input request.
Can anyone pls suggest me how i can do this ?
public class Details
{
public string status { get; set; }
public MessageInfo messageInfo { get; set; }
}
public class MessageInfo
{
public bool isValid { get; set; }
}
var inputMessage =
{
"Body":
{
"status":"success",
"MessageInfo":
{
"isValid":null
}
}
}
var messagebody = inputMessage.Body.ToObject<Details>();