/// <summary> /// Initializes a new instance of the <see cref="PeriodSummaryDTO"/> class /// </summary> /// <param name="stagePeriod">A <see cref="stagePeriodEndpoint"/> containing data</param> internal PeriodSummaryDTO(stagePeriodEndpoint stagePeriod) { Guard.Argument(stagePeriod, nameof(stagePeriod)).NotNull(); Guard.Argument(stagePeriod.sport_event, nameof(stagePeriod.sport_event)).NotNull(); Id = URN.Parse(stagePeriod.sport_event.id); PeriodStatuses = new List <PeriodStatusDTO>(); if (stagePeriod.period_statuses != null && stagePeriod.period_statuses.Any()) { PeriodStatuses = stagePeriod.period_statuses.Select(s => new PeriodStatusDTO(s)); } GeneratedAt = stagePeriod.generated_atSpecified ? stagePeriod.generated_at.ToLocalTime() : (DateTime?)null; }
/// <summary> /// Initializes a new instance of the <see cref="PeriodSummaryMapper"/> class. /// </summary> /// <param name="data">A <see cref="stagePeriodEndpoint"/> instance containing fixture data</param> internal PeriodSummaryMapper(stagePeriodEndpoint data) { Guard.Argument(data, nameof(data)).NotNull(); _data = data; }