I have four different classes for four different JSON messages. The messages always come together and I need to handle them at the same time. The code is in one try - catch block and I search the right class by deserializing the JSON.
var convertedObject = JsonConvert.DeserializeObject<Class>(message);
but this three times throw an exception ann ones successfully continue. What I want to do is check first class, if error check another class up to four and only if no class matches throw an exception. Is this possible in one try - catch block?
Thanks a lot