I've a method that deserialize string into a type.
var data = JsonConvert.DeserializeObject<TestData>("invalid json");
If string is not valid, JsonReaderException
occurring.
I want to return default value of TestData
(null) when string is not valid instead of throw exception.
How can I do this without try/catch
and JObject
?