public async Task <IHttpActionResult> Get([FromBody] DtoDestino item) { try { List <DtoDestino> lista = new List <DtoDestino>(); await Task.Run(() => { lista = LogicaDestino.ConsultarDestinos(item); }); if (lista != null) { return(Ok(lista)); } else { return(NotFound()); } } catch (Exception ex) { ClsVisorEventos.LogEvent(ex); return(BadRequest($"Incorrect call:{ex.Message}")); } }
public async Task <IHttpActionResult> Delete([FromBody] DtoDestino item) { try { if (item != null) { await Task.Run(() => { LogicaDestino.EliminarDestino(item); }); return(Ok()); } else { return(BadRequest("Incorrect call")); } } catch (Exception ex) { ClsVisorEventos.LogEvent(ex); return(BadRequest($"Incorrect call:{ex.Message}")); } }