示例#1
0
 public User Build()
 {
     var user = new User(_name);
     _barks.ForEach(x => user.AddBark(x));
     _followingUsers.ForEach(x => user.AddFollowingUser(x));
     return user;
 }
示例#2
0
文件: Post.cs 项目: asierba/barker
        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)));
        }
示例#3
0
 public UserBuilder Following(User user)
 {
     _followingUsers.Add(user);
     return this;
 }
示例#4
0
文件: User.cs 项目: asierba/barker
 public void AddFollowingUser(User user)
 {
     FollowingUsers = new ReadOnlyCollectionBuilder<User>(FollowingUsers) {user}.ToReadOnlyCollection();
 }
示例#5
0
 public void Add(User user)
 {
     _users.Add(user);
 }