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>(); }
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"); }
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); }