Inheritance: IDomainEvent
Beispiel #1
0
 void IHandleClientStateTransitions.When(ClientRegistered @event)
 {
     Identity = @event.ClientId;
     identityNumber = @event.IdentityNumber;
     clientName = @event.ClientName;
     primaryContactNumber = @event.PrimaryContactNumber;
     dateOfBirth = @event.IdentityNumber.GetDateOfBirth();
 }
        public void When(ClientRegistered @event)
        {
            var clientModel = new ClientModel
            {
                DateOfBirth = @event.IdentityNumber.GetDateOfBirth(),
                IdentityNumber = @event.IdentityNumber.Number,
                FirstName = @event.ClientName.FirstName,
                Surname = @event.ClientName.Surname,
                PrimaryContactNumber = @event.PrimaryContactNumber.Number,
                IsDeceased = false
            };

            repository.Add(clientModel);
        }