示例#1
0
        public async Task <IEnumerable <Race> > GetAllAsync()
        {
            var races = (await _readingRepository.ReadingsAsync()).ToList().Select(item => new Race()
            {
                Reads   = _readRepository.Reads.Where(x => x.ReadingId == item.Id).ToList(),
                Reader  = _readerRepository.Readers.FirstOrDefault(x => x.Id == item.ReaderId),
                Reading = item
            }).ToList();

            return(races);
        }
示例#2
0
 public async Task <IEnumerable <Reading> > GetAllAsync()
 {
     return(await _readingRepository.ReadingsAsync());
 }
示例#3
0
 public async Task <Reading> GetByIdAsync(Guid readingId)
 {
     return((await _readingRepository.ReadingsAsync()).FirstOrDefault(x => x.Id == readingId));
 }