/// <summary> /// Gets the user follow. /// </summary> /// <param name="userFollow">The user follow.</param> /// <returns></returns> private Model.UserFollow.UserFollow getUserFollow(user_follow userFollow) { Model.UserFollow.UserFollow newUserFollow = new XareuServices.Model.UserFollow.UserFollow(); newUserFollow.UserFollowed.Id = userFollow.user_id_followed; newUserFollow.UserFollowed.Nick = userFollow.user1.user_nick; newUserFollow.UserFollowed.Email = userFollow.user1.user_email; newUserFollow.UserFollowing.Id = userFollow.user_id_follower; newUserFollow.UserFollowing.Nick = userFollow.user.user_nick; newUserFollow.UserFollowing.Email = userFollow.user.user_email; return(newUserFollow); }
/// <summary> /// Adds the user follow. /// </summary> /// <param name="userId">The user id.</param> /// <param name="userFollowedId">The user followed id.</param> /// <returns>True if it was OK, false otherwise</returns> public bool AddUserFollow(long userId, long userFollowedId) { user_follow newUserFollow = new user_follow(); try { newUserFollow.user_id_follower = userId; newUserFollow.user_id_followed = userFollowedId; data.user_follows.InsertOnSubmit(newUserFollow); data.SubmitChanges(); return(true); } catch { return(false); } }