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)); }
public RoomsSearchQuery(RoomSearchFilterInput filter) : base(filter.WithPaging, filter.Page, filter.PageSize, filter.Sort.ToExpression(), filter.Sorting) { _filter = filter; }