public void Update(BoletoUpdateViewModel boleto) { var _boleto = _terminalBusContext.Boletos.Find(boleto.IdBoleto); if (_boleto != null) { _boleto.IdViaje = boleto.IdViaje; _boleto.Asiento = boleto.Asiento; _boleto.FechaCompra = boleto.FechaCompra; _terminalBusContext.Boletos.Update(_boleto); _terminalBusContext.SaveChanges(); } }
public ActionResult Update(BoletoUpdateViewModel boleto) { try { _boletoService.Update(boleto); } catch (Exception) { return(new JsonResult("Oops! algo salio mal.") { StatusCode = 400 }); } return(new JsonResult("OK") { StatusCode = 200 }); }