Пример #1
0
        public async Task <ActionResult <ICollection <SessionResponse> > > GetByTrack(int trackId, DateTimeOffset?fromDate = null,
                                                                                      DateTimeOffset?toDate = null)
        {
            fromDate = fromDate ?? DateTimeOffset.MinValue;
            toDate   = toDate ?? DateTimeOffset.MaxValue;

            var result = (await _sessionsRepository.GetByTrackIdAsync(trackId))
                         .Where(s => IsSessionWithinDateRange(fromDate, toDate, s))
                         .Select(m => m.MapSessionResponse())
                         .ToList();

            return(result);
        }