public IEnumerable <Room> GetRoomsForHotel(int hotelId, RoomParameters roomParameters) { var rooms = _hotelAppContext.Set <Room>().AsQueryable(); rooms = FilterRooms(ref rooms, roomParameters); rooms = rooms.Where(r => r.HotelId == hotelId); rooms = _sort.ApplySort(rooms, roomParameters.OrderBy); return(PagedList <Room> .ToPagedList(rooms, roomParameters.PageNumber, roomParameters.PageSize)); }
public virtual IEnumerable <T> GetAll() { return(_context.Set <T>().AsEnumerable()); }