예제 #1
0
        public ActionResult <Page <RoomResponse> > GetRooms([FromQuery] RoomSearchFilterInput filter)
        {
            if (filter == null)
            {
                filter = new RoomSearchFilterInput();
            }

            var roomsPageResponse = new RoomsSearchQuery(filter)
                                    .Execute(_roomRepository);

            foreach (var roomResponse in roomsPageResponse.Items)
            {
                var selfLink = GetRoomSelfLinkById(roomResponse.Id.Value);

                roomResponse.WithLinks(selfLink);
            }

            return(Ok(roomsPageResponse));
        }
예제 #2
0
 public RoomsSearchQuery(RoomSearchFilterInput filter)
     : base(filter.WithPaging, filter.Page, filter.PageSize, filter.Sort.ToExpression(), filter.Sorting)
 {
     _filter = filter;
 }