Beispiel #1
0
        public SocialEventDTO(ISocialEvent socialEvent)
        {
            if (socialEvent.Id < 0)
            {
                throw new ArgumentOutOfRangeException($"{nameof(socialEvent.Id)} cannot be less than 0.");
            }
            RegattaDTO regatta = new RegattaDTO(socialEvent.Regatta);

            ValidateInParameters(socialEvent.Name, socialEvent.Location, socialEvent.Fee, socialEvent.StartDate, socialEvent.EndDate, socialEvent.MaxParticipants, socialEvent.Regatta.Id);

            Id              = socialEvent.Id;
            Name            = socialEvent.Name;
            Location        = socialEvent.Location;
            Fee             = socialEvent.Fee;
            Description     = socialEvent.Description;
            StartDate       = socialEvent.StartDate;
            EndDate         = socialEvent.EndDate;
            MaxParticipants = socialEvent.MaxParticipants;
            RegattaId       = socialEvent.Regatta.Id;
            Active          = socialEvent.Active;
            sa_Info         = socialEvent.sa_Info;
            Regatta         = regatta;
        }
Beispiel #2
0
 public static SocialEventDTO MappFrom(ISocialEvent socialEvent)
 {
     return(new SocialEventDTO(socialEvent));
 }