예제 #1
0
파일: TeamViewModel.cs 프로젝트: hva/zubrs
        public async Task InitAsync(int? id)
        {
            Teams = await Repository.Teams
                .Where(x => x.ShowInMenu)
                .OrderBy(x => x.Sortorder)
                .ToArrayAsync();

            Team = Teams.FirstOrDefault(x => !id.HasValue || x.Id == id);
            if (Team == null)
            {
                throw new HttpException(404, "Page not found");
            }
            await Repository.LoadPlayersAsync(Team);
        }
예제 #2
0
파일: DataRepository.cs 프로젝트: hva/zubrs
 public async Task LoadPlayersAsync(Team team)
 {
     await Context.Entry(team).Collection(x => x.Players).LoadAsync();
 }