Ejemplo n.º 1
0
        public Member(Contact contact, LicensePlate licensePlate, DateTime registrationDate, MemberShipLevel.Level memberShipLevel = Domain.MemberShipLevel.Level.Bronze)
        {
            if (contact == null)
            {
                throw new ValidationException <Member>("contact is required");
            }

            if (licensePlate == null)
            {
                throw new ValidationException <Member>("licensePlate is required");
            }

            if (default(DateTime) == registrationDate)
            {
                throw new ValidationException <Member>("registrationDate is required");
            }

            this.Contact          = contact;
            this.LicensePlate     = licensePlate;
            this.RegistrationDate = registrationDate;
            this.MemberShipLevel  = memberShipLevel;
        }