Esempio n. 1
0
 public static bool EditarVotacion(Votaciones votacion)
 {
     using (var cliente = new HttpClient())
     {
         cliente.BaseAddress = new Uri(urlBWA);
         var putTask = cliente.PutAsJsonAsync($"api/votaciones/{votacion.Id}", votacion);
         putTask.Wait();
         var result = putTask.Result;
         return(result.IsSuccessStatusCode);
     }
 }
Esempio n. 2
0
 public static bool CrearVotacion(Votaciones votacion)
 {
     using (var cliente = new HttpClient())
     {
         cliente.BaseAddress = new Uri(urlBWA);
         var postTask = cliente.PostAsJsonAsync <Votaciones>("api/votaciones", votacion);
         postTask.Wait();
         var result = postTask.Result;
         return(result.IsSuccessStatusCode);
     }
 }