Esempio n. 1
0
        /// <summary>
        /// Take all bookings
        /// </summary>
        public async Task <IEnumerable <BookingReturnContract> > TakeAllBooking(CancellationToken token)
        {
            var bookings = _dbContext.Bookings
                           .Select(x => BookingMapping.BookingMapFromModelTToContract(x.Slot, x))
                           .AsEnumerable()
                           .OrderBy(x => x.Slot?.CoachId).ThenBy(x => x.Slot?.DateStart).ThenBy(x => x.Slot?.TimeStart);

            return(bookings);
        }
Esempio n. 2
0
        /// <summary>
        /// Take booking for client
        /// </summary>
        /// <param name="clientId"></param>
        /// <param name="token"></param>
        public async Task <IEnumerable <BookingReturnContract> > TakeBookingOnClient(int clientId, CancellationToken token)
        {
            var bookings = _dbContext.Bookings
                           .Where(x => x.ClientId == clientId)
                           .Select(x => BookingMapping.BookingMapFromModelTToContract(x.Slot, x))
                           .AsEnumerable()
                           .OrderBy(x => x.Slot?.DateStart).ThenBy(x => x.Slot?.TimeStart);

            return(bookings);
        }