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); }
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)); }