Example #1
0
        public RaceEventDTO(IRaceEvent raceEvent)
        {
            if (raceEvent.Id < 0)
            {
                throw new ArgumentOutOfRangeException($"{nameof(raceEvent.Id)} cannot be less than 0.");
            }
            RegattaDTO regatta = new RegattaDTO(raceEvent.Regatta);

            ValidateInParameters(raceEvent.Name, raceEvent.Location, raceEvent.Fee, raceEvent.StartDate, raceEvent.EndDate, raceEvent.MaxParticipants, raceEvent.Regatta.Id, raceEvent.Class, raceEvent.Type);

            Id              = raceEvent.Id;
            Name            = raceEvent.Name;
            Location        = raceEvent.Location;
            Fee             = raceEvent.Fee;
            Description     = raceEvent.Description;
            StartDate       = raceEvent.StartDate;
            EndDate         = raceEvent.EndDate;
            MaxParticipants = raceEvent.MaxParticipants;
            RegattaId       = raceEvent.Regatta.Id;
            Active          = raceEvent.Active;
            sa_Info         = raceEvent.sa_Info;
            Regatta         = regatta;
            Class           = raceEvent.Class;
            Type            = raceEvent.Type;
        }
Example #2
0
 public static RaceEventDTO MappFrom(IRaceEvent raceEvent)
 {
     return(new RaceEventDTO(raceEvent));
 }
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="timestamp">timestamp at which the data occurred</param>
 /// <param name="raceEvent">the interface for reporting race events</param>
 public TimestampData(long timestamp, IRaceEvent raceEvent)
 {
     Timestamp      = timestamp;
     this.RaceEvent = raceEvent;
 }