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); }
public async Task <IEnumerable <Reading> > GetAllAsync() { return(await _readingRepository.ReadingsAsync()); }
public async Task <Reading> GetByIdAsync(Guid readingId) { return((await _readingRepository.ReadingsAsync()).FirstOrDefault(x => x.Id == readingId)); }