private static Domain.Team Convert(Team team) { var domainTeam = new Domain.Team(team.Name, team.RaceId, team.ChipId); domainTeam.SetPropertyValue( "Id", team.TeamId); domainTeam.SetPropertyValue( "Laps", new ReadOnlyCollection <Domain.Lap>(team.Laps?.Select(Convert).ToList() ?? new List <Domain.Lap>())); return(domainTeam); }
private static Domain.Team Convert(Team team) { var result = new Domain.Team(team.Name, new Guid(team.RaceId), team.ChipId); result.SetPropertyValue( "Id", new Guid(team.TeamId)); result.SetPropertyValue( "Laps", new ReadOnlyCollection <Domain.Lap>(team.Laps.Select(Convert).ToList())); return(result); }