public LeagueStatisticSetEntity MapToLeagueStatisticSetEntity(LeagueStatisticSetDTO source, LeagueStatisticSetEntity target = null) { if (source == null) { return(null); } if (target == null) { target = DefaultGet <LeagueStatisticSetEntity>(source); } if (MapToRevision(source, target) == false) { return(target); } MapToStatisticSetEntity(source, target, force: true); MapCollection(source.SeasonStatisticSetIds.Select(x => new StatisticSetDTO() { Id = x }), target.StatisticSets, DefaultGet <StatisticSetDTO, StatisticSetEntity>, x => x.Keys, removeFromCollection: true); return(target); }
public LeagueStatisticSetDTO MapToLeagueStatisticSetDTO(LeagueStatisticSetEntity source, LeagueStatisticSetDTO target = null) { if (source == null) { return(null); } if (target == null) { target = new LeagueStatisticSetDTO(); } MapToStatisticSetDTO(source, target); target.SeasonStatisticSetIds = source.StatisticSets.Select(x => x.Id).ToArray(); return(target); }