Exemplo n.º 1
0
 internal void Apply(UserSubmittedEvent userSubmittedEvent)
 {
     Id              = userSubmittedEvent.AggregateId;
     EmailAddress    = userSubmittedEvent.EmailAddress;
     Password        = userSubmittedEvent.Password;
     UserStatus      = userSubmittedEvent.UserStatus;
     DateTimeCreated = userSubmittedEvent.DateTimeCreated;
 }
Exemplo n.º 2
0
        public User(Guid userId, string emailAddress)
        {
            if (userId == Guid.Empty)
            {
                throw new ArgumentException(nameof(userId));
            }

            if (string.IsNullOrWhiteSpace(emailAddress))
            {
                throw new ArgumentNullException(nameof(emailAddress));
            }

            var userSubmittedEvent = new UserSubmittedEvent(userId, Version,
                                                            emailAddress, string.Empty, UserStatus.VerificationPending, DateTime.UtcNow);

            ApplyEvent(userSubmittedEvent, Version + 1);
            UncommittedEvents.Add(userSubmittedEvent);
        }