private void AddUser(User user, IEnumerable <User> follows) { CreateOrGetUserFeed(user); foreach (var follow in follows) { UserFeed userFeed = CreateOrGetUserFeed(follow); userFeed.AddFollower(user); } }
private void AddTweet(Tweet tweet) { if (tweet == null) { throw new ArgumentNullException("tweet"); } UserFeed userFeed = CreateOrGetUserFeed(tweet.Creator); userFeed.AddTweet(tweet); foreach (var follower in userFeed.FollowedBy) { UserFeed followerFeed = CreateOrGetUserFeed(follower); followerFeed.AddTweet(tweet); } }