Exemplo n.º 1
0
        public async Task <IActionResult> Create([FromBody] Reservation reservation)
        {
            await _context.Reservations.AddAsync(reservation);

            await _context.SaveChangesAsync();

            return(CreatedAtRoute("GetReservation", new { id = reservation.Id }, reservation));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([FromBody] Room room)
        {
            await _context.Rooms.AddAsync(room);

            await _context.SaveChangesAsync();

            return(CreatedAtRoute("GetRoom", new { id = room.Id }, room));
        }