Пример #1
0
        public async Task <Data.Loan> DeleteLoanAsync(string GUID)
        {
            if (GUID == "")
            {
                throw new InvalidOperationException("Missing GUID");
            }

            HttpRequestMessage message = new HttpRequestMessage(HttpMethod.Delete, string.Format("{0}/{1}", API_PATH, GUID));

            var response = await client.SendAsync(message);

            //await client.DeleteAsync(API_PATH + "/" + GUID);
            if (response.StatusCode == HttpStatusCode.NoContent)
            {
                Data.Loan tloan = null;
                try
                {
                    tloan = await GetLoanAsync(GUID);
                }
                catch (FileNotFoundException)
                {
                }
                return(tloan);
            }
            else
            {
                throw new RESTException("DeleteLoanAsync", response);
            }
        }
Пример #2
0
 public async Task <Data.Loan> PatchLoanAsync(Data.Loan Loan)
 {
     return(await PatchLoanAsync(Loan.JsonValue, Loan.encompassId));
 }
Пример #3
0
 public async Task <Data.Loan> PostLoanAsync(Data.Loan Loan)
 {
     return(await PostLoanAsync(Loan.JsonValue));
 }