Exemple #1
0
        public Customer(Guid customerId, string name, DateTime? birthDate)
        {
            EventSourceId = customerId;

            if (!GenericValidationRules.ValidName(name)) throw new InvalidDataException("name not valid.");

            var e = new CustomerCreated{ CustomerId = customerId, Name = name, BirthDate = birthDate };
            ApplyEvent(e);
        }
Exemple #2
0
 private void OnCreated(CustomerCreated e)
 {
     _name = e.Name;
     _birthDate = e.BirthDate;
 }