예제 #1
0
        public IHttpActionResult Put(Room room)
        {
            var roomToUpdate = _roomService.GetById(room.Id);

            if (roomToUpdate == null)
            {
                return NotFound();
            }

            roomToUpdate.Name = room.Name;

            _roomService.Update(roomToUpdate);

            return Ok(roomToUpdate);
        }
예제 #2
0
 public IHttpActionResult Post(Room room)
 {
     return Ok(_roomService.Add(room));
 }