예제 #1
0
    public async Task <Hotel> Handle(UpdateHotelCommand request, CancellationToken cancellationToken)
    {
        var myhotel = await hotelsServices.GetHotel(request.Id);

        if (myhotel != null)
        {
            myhotel.Categoria       = request.Categoria;
            myhotel.Descripcion     = request.Descripcion;
            myhotel.Nombre          = request.Nombre;
            myhotel.Destacado       = request.Destacado;
            myhotel.Localidad       = request.Localidad;
            myhotel.Caracteristicas = request.Caracteristicas;
            await hotelsServices.UpdateHotelAsync(myhotel);

            return(myhotel);
        }
        return(null);
    }
예제 #2
0
 public Task <Hotel> Handle(GetHotelByIdRequest request, CancellationToken cancellationToken) => hotelsServices.GetHotel(request.Id);