Exemple #1
0
        public void UpdateEmailAddress(Guid userId, string emailAddress)
        {
            if (string.IsNullOrWhiteSpace(emailAddress))
            {
                throw new ArgumentException(nameof(emailAddress));
            }

            var userUpdatedEvent = new UserUpdatedEvent(
                userId, Version, emailAddress, UserStatus.VerificationPending);

            ApplyEvent(userUpdatedEvent, Version + 1);
            UncommittedEvents.Add(userUpdatedEvent);
        }
Exemple #2
0
 internal void Apply(UserUpdatedEvent userUpdatedEvent)
 {
     EmailAddress = userUpdatedEvent.EmailAddress;
     UserStatus   = userUpdatedEvent.UserStatus;
 }