Пример #1
0
        private void SeedSquads()
        {
            var seasonTask = _seasonRepository.SingleOrDefaultAsync(s => s.Name == "2018/2019");

            seasonTask.Wait();
            var season = seasonTask.Result;

            var clubsTask = _clubRepository.GetAllAsync();

            clubsTask.Wait();

            foreach (var club in clubsTask.Result)
            {
                var squad = new Squad
                {
                    Season = season,
                    Club   = club
                };

                _squadRepository.Add(squad);
            }

            _unitOfWork.CompleteAsync().Wait();
        }
Пример #2
0
 public async Task <IEnumerable <Club> > GetAll()
 {
     return(await _clubRepository.GetAllAsync());
 }