コード例 #1
0
        /// <summary>
        /// stop following the target
        /// </summary>
        /// <param name="targetUserId">target(followee) user id</param>
        /// <param name="followerUserId">the follower user id</param>
        public void UnFollow(Guid targetUserId, Guid followerUserId)
        {
            var targetPid   = MyUserManager.FindByIdAsync(targetUserId).Result.Profiles[OldHouseUserProfile.PROFILENBAME];
            var followerPid = MyUserManager.FindByIdAsync(followerUserId).Result.Profiles[OldHouseUserProfile.PROFILENBAME];

            FollowService.UnFollow(targetPid, followerPid);
        }
コード例 #2
0
        /// <summary>
        /// toggle the follow of a user
        /// </summary>
        /// <param name="targetUserId"></param>
        /// <param name="followerUserId"></param>
        /// <returns></returns>
        public bool ToggoleFollow(Guid targetUserId, Guid followerUserId)
        {
            var targetPid   = MyUserManager.FindByIdAsync(targetUserId).Result.Profiles[OldHouseUserProfile.PROFILENBAME];
            var user        = MyUserManager.FindByIdAsync(targetUserId).Result;
            var followerPid = MyUserManager.FindByIdAsync(followerUserId).Result.Profiles[OldHouseUserProfile.PROFILENBAME];

            if (FollowService.AmIFollowing(targetPid, followerPid))
            {
                FollowService.UnFollow(targetPid, followerPid);
                return(false);
            }
            else
            {
                FollowService.Follow(targetPid, followerPid);
                return(true);
            }
        }