The json token.ToObject<T>
method can throw if json is not able to convert the data in token the to the type T
.
I would like to do a early test and need a method like this:
bool JsonConvert.CanConvert<TSrc, TDest>();
I don't find any reference to something close to it.
[Precision]
Actually TSrc
here is not composed but a basic type.
[Edit]
When I say that I want to do an early test, I talk about a test done before any attempt to parse somethings.
Actually I don't have any json file around when I need to do the test.
So the TryParse or the TryCatch pattern doesn't match my need.