private void SetearHospedaje(int hospedajeId, Reserva retorno)
        {
            Hospedaje hospedaje = this.logicaHospedaje.ObtenerPorId(hospedajeId);

            hospedaje.Ocupado = true;
            logicaHospedaje.ActualizarHospedaje(hospedaje);
            retorno.Hospedaje = hospedaje;
        }
Beispiel #2
0
 public IActionResult Put(int id, [FromBody] HospedajeModel hospedajeModel)
 {
     try
     {
         Hospedaje hospedaje = hospedajeModel.ToEntity();
         hospedaje.Id = id;
         logic.ActualizarHospedaje(hospedaje);
         return(Ok());
     }
     catch (EntidadNoExisteExcepcion)
     {
         return(NotFound("No existe el hospedaje"));
     }
 }