Esempio n. 1
0
 /// <summary>
 /// Returns a Resource from a WebRequest
 /// </summary>
 /// <param name="webRequest">WebRequest to get the response from</param>
 /// <returns>The Resource representation of the JSON response or null if there was an error parsing the returned JSON.</returns>
 private Resource getResourceByRequest(gdapi.WebRequest webRequest)
 {
     Resource result = null;
     string sResponse = webRequest.getResponse();
     result = (Resource)JsonConvert.DeserializeObject(sResponse, typeof(Resource), new ResourceConverter());
     return result;
 }
Esempio n. 2
0
 /// <summary>
 /// Returns a Collection from a WebRequest.
 /// </summary>
 /// <param name="webRequest">WebRequest to get the response from</param>
 /// <returns>The Collection representation of the JSON response or null if there was an error parsing the returned JSON.</returns>
 private Collection getCollectionByRequest(gdapi.WebRequest webRequest)
 {
     string sResponse = webRequest.getResponse();
      return (Collection)JsonConvert.DeserializeObject(sResponse, typeof(Collection), new ResourceConverter());
 }