Exemplo n.º 1
0
 private void CreateMaps()
 {
     _mapper.CreateMap <NFLTeam, NFLTeamDTO>();
     _mapper.CreateMap <NFLGame, NFLGameDTO>();
     _mapper.ExcludeProperty <NFLTeam, NFLTeamDTO>("HomeGames");
     _mapper.ExcludeProperty <NFLTeam, NFLTeamDTO>("AwayGames");
     _mapper.CreateMap <NFLTeamDTO, NFLTeam>();
 }
Exemplo n.º 2
0
 private void CreateMaps()
 {
     Mapper.CreateMap <NFLWeek, NFLWeekDTO>();
     Mapper.CreateMap <NFLGame, NFLGameDTO>();
     Mapper.CreateMap <NFLTeam, NFLTeamDTO>();
     Mapper.ExcludeProperty <NFLTeam, NFLTeamDTO>("HomeGames");
     Mapper.ExcludeProperty <NFLTeam, NFLTeamDTO>("AwayGames");
 }
Exemplo n.º 3
0
        public NFLSeasonDTO GetCurrentNFLSeason()
        {
            _mapper.ExcludeProperty <NFLTeam, NFLTeamDTO>("HomeGames");
            _mapper.ExcludeProperty <NFLTeam, NFLTeamDTO>("AwayGames");

            var season        = _nflSeasonService.GetCurrentNFLSeason();
            var currentSeason = _mapper.Map <NFLSeasonDTO>(season);

            currentSeason.CurrentWeek = _mapper.Map <NFLWeekDTO>(_nflSeasonService.GetNFLWeek(season.CurrentWeekId));

            return(currentSeason);
        }