Exemple #1
0
        public bool removeFollowingFromUser(ApplicationUser a, ApplicationUser toDel)
        {
            UserFollowConnection uConnection = getUserFollowConnectionByUsers(a, toDel);

            a.NumberOfFollowing--;
            db.UserFollowConnections.Remove(uConnection);
            return(db.SaveChanges() != 0);
        }
Exemple #2
0
        public bool addFollowingToUser(ApplicationUser a, ApplicationUser toAdd)
        {
            UserFollowConnection uConnection = new UserFollowConnection();

            uConnection.FollowerID = a.Id;
            a.NumberOfFollowing++;
            uConnection.FollowingID = toAdd.Id;
            db.UserFollowConnections.Add(uConnection);
            return(db.SaveChanges() != 0);
        }
Exemple #3
0
        public bool removeFollowerFromUser(ApplicationUser a, ApplicationUser toDel)
        {
            UserFollowConnection uConnection = new UserFollowConnection();

            uConnection.FollowingID = a.Id;
            a.NumberOfFollowers--;
            uConnection.FollowerID = toDel.Id;
            db.UserFollowConnections.Remove(uConnection);
            return(db.SaveChanges() != 0);
        }