I have the following problem.
I make a request rest to a service, e.g.
link
the answer is like this if it exists:
{
"Id": 7113,
"Name": "Ted Norris",
"BirthDate": "1977-05-13T00:00:00",
"Phone": "488-555-1212",
"Address": {
"Street": "123 Main St",
"City": "San Diego",
"State": "CA",
"Zip": "92115"
}
and if there is any error this other answer
{
"IsSuccess": false,
"Message": "Can not connect to database"
}
How can I deserialize two different objects, what would be the best way to do it.
If it can be Using the library Newtonsoft.Json
thank you very much.