/// <summary>
 /// Get the parsed object from the response JSON string.
 /// </summary>
 /// <example>
 /// <code>
 /// class Model {
 ///     public int id { get; set; }
 ///     public string name { get; set; }
 /// }
 ///
 /// var response = await client.sendRequest(httpRequest.getApiRequestBundle());
 /// Model model = response.getParsedObject<Model>();
 /// </code>
 /// </example>
 /// <typeparam name="T">A generic param. Adjust with your needs</typeparam>
 /// <returns>T</returns>
 public T getParsedObject <T>()
 {
     if (httpResponseMessage.Content == null)
     {
         throw new NullReferenceException("Http response content is null.");
     }
     return(JSONOperation.parseJSON <T>(httpResponseMessage.Content.ReadAsStringAsync().Result));
 }
Пример #2
0
 public Startup()
 {
     UserServiceObj           = new UserService();
     PoolObj                  = new Pool();
     WalletServiceObj         = new WalletServices();
     RideServiceObj           = new RideServices();
     BookingServiceObj        = new BookingService();
     PaymentServiceObj        = new PaymentService();
     ReviewServiceObj         = new ReviewService();
     RequestServiceObj        = new RequestService();
     PaymentReceiptServiceObj = new PaymentReceiptService();
     VehicleServiceObj        = new VehicleService();
     JSONOperationObj         = new JSONOperation();
     FileOperationObj         = new FileOperation();
 }
Пример #3
0
 public void addJSON <T>(T _object)
 {
     json = JSONOperation.convertToJSONString <T>(_object);
 }