Пример #1
0
 /// <summary>
 /// Deserialize data from a RestSharp.RestResponse into a T-type object, using this instance's <see cref="JsonSerializerSettings"/>
 /// </summary>
 /// <param name="response">RestSharp.RestResponse object to extract data from.</param>
 /// <param name="rootElementKeys">List, in order, of sub-keys path to follow to deserialization starting position.</param>
 /// <typeparam name="T">Type of object to deserialize to</typeparam>
 /// <returns>A T-type object</returns>
 public T ConvertJsonToObject <T>(RestResponse response, List <string>?rootElementKeys = null) => JsonSerialization.ConvertJsonToObject <T>(response, JsonSerializerSettings, rootElementKeys);
Пример #2
0
 /// <summary>
 /// Deserialize a JSON string into a T-type object, using this instance's <see cref="JsonSerializerSettings"/>
 /// </summary>
 /// <param name="data">A string of JSON data</param>
 /// <param name="rootElementKeys">List, in order, of sub-keys path to follow to deserialization starting position.</param>
 /// <typeparam name="T">Type of object to deserialize to</typeparam>
 /// <returns>A T-type object</returns>
 public T ConvertJsonToObject <T>(string data, List <string>?rootElementKeys = null) => JsonSerialization.ConvertJsonToObject <T>(data, JsonSerializerSettings, rootElementKeys);