How to prevent JsonReaderException when json is not valid in JsonConvert.DeserializeObject

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? >Solution : You can use JsonSerializerSettings to… Read More How to prevent JsonReaderException when json is not valid in JsonConvert.DeserializeObject