Esempio n. 1
0
 public async Task AddFlight(PostFlightModel model)
 {
     using (var client = _httpClientFactory.CreateClient("flight"))
     {
         await client.PostAsync(client.BaseAddress, model.GetStringContent());
     }
 }
Esempio n. 2
0
 public async Task UpdateFlight(PostFlightModel model)
 {
     using (var client = _httpClientFactory.CreateClient("flight"))
     {
         var uri = $"{client.BaseAddress}/{model.Id}";
         try
         {
             await client.PutAsync(uri, model.GetStringContent());
         }
         catch (System.Exception ex)
         {
             throw;
         }
     }
 }