/// <summary> /// Merges the specified <see cref="SportEventConditionsDTO"/> into instance /// </summary> /// <param name="dto">A <see cref="SportEventConditionsDTO"/> containing information about the sport event conditions</param> /// <param name="culture">A <see cref="CultureInfo"/> specifying the language of the sport event conditions</param> internal void Merge(SportEventConditionsDTO dto, CultureInfo culture) { Guard.Argument(dto, nameof(dto)).NotNull(); Guard.Argument(culture, nameof(culture)).NotNull(); Attendance = dto.Attendance; EventMode = dto.EventMode; if (dto.Referee != null) { if (Referee == null) { Referee = new RefereeCI(dto.Referee, culture); } else { Referee.Merge(dto.Referee, culture); } } if (dto.WeatherInfo != null) { WeatherInfo = new WeatherInfoCI(dto.WeatherInfo); } if (dto.Pitchers != null) { Pitchers = dto.Pitchers.Select(s => new PitcherCI(s, culture)); } }
/// <summary> /// Merges the specified <see cref="SportEventConditionsDTO" /> into instance /// </summary> /// <param name="dto">A <see cref="SportEventConditionsDTO" /> containing information about the sport event conditions</param> /// <param name="culture">A <see cref="CultureInfo" /> specifying the language of the sport event conditions</param> internal void Merge(SportEventConditionsDTO dto, CultureInfo culture) { Contract.Requires(dto != null); Contract.Requires(culture != null); Attendance = dto.Attendance; EventMode = dto.EventMode; if (dto.Referee != null) { if (Referee == null) { Referee = new RefereeCI(dto.Referee, culture); } else { Referee.Merge(dto.Referee, culture); } } if (dto.WeatherInfo != null) { WeatherInfo = new WeatherInfoCI(dto.WeatherInfo); } if (dto.Pitchers != null) { Pitchers = dto.Pitchers.Select(s => new PitcherCI(s, culture)); } }