Exemplo n.º 1
0
 public IUserVisitor Visit(EmailChanged @event)
 {
     var origUser = this.users.Single(u => u.Id == @event.UserId);
     var newUser = new User(
         origUser.Id,
         origUser.Name,
         origUser.Password,
         @event.NewEmail,
         false);
     var newUsers = this.users
         .Where(u => u.Id != newUser.Id)
         .Concat(new[] { newUser });
     return new UserVisitor(newUsers);
 }
Exemplo n.º 2
0
        public IUserVisitor Visit(EmailChanged @event)
        {
            var origUser = this.users.Single(u => u.Id == @event.UserId);
            var newUser  = new User(
                origUser.Id,
                origUser.Name,
                origUser.Password,
                @event.NewEmail,
                false);
            var newUsers = this.users
                           .Where(u => u.Id != newUser.Id)
                           .Concat(new[] { newUser });

            return(new UserVisitor(newUsers));
        }