public static async Task<HttpResponseMessage> Add(Sale sale) { using (var c = APIService.GetClient()) { string json = JsonConvert.SerializeObject(sale); StringContent content = new StringContent(json, Encoding.UTF8, "application/json"); return await c.PostAsync($"sales", content); } }
public static async Task<HttpResponseMessage> Delete(Sale sale) { using (var c = APIService.GetClient()) { return await c.DeleteAsync($"sales/{sale.Id}"); } }