Exemplo n.º 1
0
        public async Task <IActionResult> AddAmenity(int RoomID, string Name)
        {
            var amenities = await _context.GetAllAmenitiesList();

            int ID = amenities.First(x => x.Name == Name).ID;
            await _context.AddAmenityToRoom(RoomID, ID);

            return(RedirectToAction(nameof(Index), "Rooms"));
        }
Exemplo n.º 2
0
 public async Task AddAmenityToRoom(int roomId, int amenityId)
 {
     await _room.AddAmenityToRoom(roomId, amenityId);
 }
Exemplo n.º 3
0
        public async Task <ActionResult <RoomDto> > AddAmenityToRoom(int roomId, int amenityId)
        {
            var roomDto = await _room.AddAmenityToRoom(roomId, amenityId);

            return(roomDto);
        }