예제 #1
0
        private async Task <ClubDto> GetFirstClubWithSummaryItems()
        {
            var club = await _repository.GetFirst();

            var clubDTO = ClubMapper.FromModelToDTO(club);

            return(clubDTO);
        }
예제 #2
0
        private async Task AddAssociationsToArticleEditDto(ArticleEditDto articleDto)
        {
            var squads = await _squadsRepository.GetAll();

            var squadAssociations = FromModelToDto(squads);

            var club = await _clubsRepository.GetFirst();

            var clubAssociations = FromModelToDTOs(club);

            // Need to call the ToArray to resolve all deferred executions.
            // This is needed because we are modifiying the IsSelected and
            // without resolution the objects in collections would refresh.
            articleDto.Associations = Enumerable.Concat(clubAssociations, squadAssociations)
                                      .ToArray();
        }