public User Build() { var user = new User(_name); _barks.ForEach(x => user.AddBark(x)); _followingUsers.ForEach(x => user.AddFollowingUser(x)); return user; }
public void Execute() { var user =_userRepository.Get(Username); if (user is NotExistingUser) { user = new User(Username); _userRepository.Add(user); } Messages.ForEach(x => user.AddBark(new Bark(Username, x, _clock.Now))); }
public UserBuilder Following(User user) { _followingUsers.Add(user); return this; }
public void AddFollowingUser(User user) { FollowingUsers = new ReadOnlyCollectionBuilder<User>(FollowingUsers) {user}.ToReadOnlyCollection(); }
public void Add(User user) { _users.Add(user); }