Beispiel #1
0
        public IQueryable <ReservationGetModel> FilterByUserId(string id)
        {
            long userId = long.Parse(id);

            IQueryable <Reservation> reservations = context.Reservations
                                                    .Where(r => r.UserId == userId);

            var query = reservations
                        .OrderBy(r => r.ArrivalDate);

            return(query.Select(r => ReservationGetModel.GetReservationModel(r, context)));
        }
Beispiel #2
0
        // Nepaginat
        public IEnumerable <ReservationGetModel> GetReservations()
        {
            IQueryable <Reservation> result = context.Reservations;

            return(result.Select(r => ReservationGetModel.GetReservationModel(r, context)));
        }