public bool removeFollowingFromUser(ApplicationUser a, ApplicationUser toDel) { UserFollowConnection uConnection = getUserFollowConnectionByUsers(a, toDel); a.NumberOfFollowing--; db.UserFollowConnections.Remove(uConnection); return(db.SaveChanges() != 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); }
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); }