/// <summary> /// Initializes a new instance of the SportEvent class. /// </summary> public SportEvent(string id, System.DateTime scheduled, bool startTimeTbd, TournamentRound tournamentRound, Season season, Tournament tournament, IList <Competitor> competitors, string status = default(string), Venue venue = default(Venue)) { Id = id; Scheduled = scheduled; StartTimeTbd = startTimeTbd; Status = status; TournamentRound = tournamentRound; Season = season; Tournament = tournament; Competitors = competitors; Venue = venue; CustomInit(); }
/// <summary> /// Validate the object. /// </summary> /// <exception cref="ValidationException"> /// Thrown if validation fails /// </exception> public virtual void Validate() { if (Id == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Id"); } if (TournamentRound == null) { throw new ValidationException(ValidationRules.CannotBeNull, "TournamentRound"); } if (Season == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Season"); } if (Tournament == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Tournament"); } if (Competitors == null) { throw new ValidationException(ValidationRules.CannotBeNull, "Competitors"); } if (TournamentRound != null) { TournamentRound.Validate(); } if (Season != null) { Season.Validate(); } if (Tournament != null) { Tournament.Validate(); } if (Competitors != null) { foreach (var element in Competitors) { if (element != null) { element.Validate(); } } } if (Venue != null) { Venue.Validate(); } }