Exemplo n.º 1
0
        public static T Deserialize <T>(string content)
        {
            var settings = new JsonSerializerSettings();
            DeserializerExceptionsContractResolver resolver =
                DeserializerExceptionsContractResolver.Instance;

            resolver.JsonToDeserialize = content;
            settings.ContractResolver  = resolver;

            return(JsonConvert.DeserializeObject <T>(content, settings));
        }
 /// <summary>
 /// Initializes static members of the <see cref="DeserializerExceptionsContractResolver" /> class.
 /// </summary>
 static DeserializerExceptionsContractResolver()
 {
     instance = new DeserializerExceptionsContractResolver();
 }