public async Task <ExpenseCollectionResponse> GetExpenseCollections(ExpenseCollectionRequest request) { var json = JsonConvert.SerializeObject(request); var resp = await PostForString(new Uri(ApiUrl + "expensecollections/act"), json); if (resp.IsSuccessfull) { try { return(JsonConvert.DeserializeObject <ExpenseCollectionResponse>(resp.Response)); } catch (Exception ex) { LogHelper.Instance.LogException(ex, this); return(new ExpenseCollectionResponse() { ErrorMessage = "Unserialisation failed for Description " + resp.Response }); } } return(new ExpenseCollectionResponse() { ErrorMessage = resp.ErrorMessage }); }
public Task <BooleanResponse> PostExpenseCollection(ExpenseCollectionRequest request) { var json = JsonConvert.SerializeObject(request); return(PostForBoolean(new Uri(ApiUrl + "expensecollections/act"), json)); }