コード例 #1
0
ファイル: UserProfile.cs プロジェクト: cwetanow/realworld
 public void Follow(UserProfile otherUser) => FollowedUsers.Add(new UserFollower(otherUser, this));
コード例 #2
0
ファイル: UserProfile.cs プロジェクト: cwetanow/realworld
        public void Unfollow(UserProfile otherUser)
        {
            var followedUser = FollowedUsers.Single(f => f.UserId == otherUser.Id);

            FollowedUsers.Remove(followedUser);
        }
コード例 #3
0
ファイル: UserProfile.cs プロジェクト: cwetanow/realworld
 public bool HasFollowed(UserProfile otherUser) => FollowedUsers.Any(f => f.UserId == otherUser.Id);