/// <summary> /// Am i following this user /// </summary> /// <param name="targetUserId">the followee user id</param> /// <param name="followerUserId">the follower userid</param> /// <returns></returns> public bool AmIFollowing(Guid targetUserId, Guid followerUserId) { var targetPid = MyUserManager.FindByIdAsync(targetUserId).Result.Profiles[OldHouseUserProfile.PROFILENBAME]; var followerPid = MyUserManager.FindByIdAsync(followerUserId).Result.Profiles[OldHouseUserProfile.PROFILENBAME]; return(FollowService.AmIFollowing(targetPid, followerPid)); }
/// <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); } }