public static List <Newsfeed> RankNewsFeed(List <Newsfeed> lst) { foreach (var post in lst) { post.AffinityScore = 0; post.PostWeight = 0; if (post.Type == Global.PHOTO || post.Type == Global.TAG_PHOTO) { post.PostWeight += Global.WEIGHT_PHOTO; } else if (post.Type == Global.VIDEO || post.Type == Global.TAG_VIDEO) { post.PostWeight += Global.WEIGHT_VIDEO; } else if (post.Type == Global.TAG_VIDEOLINK) { post.PostWeight += Global.WEIGHT_VIDEOLINK; } else if (post.Type == Global.TEXT_POST) { post.PostWeight += Global.WEIGHT_TEXT; } long likesCount = LikesDAL.countPost(post._id.ToString(), Global.WALL); long sharesCount = ShareDAL.countPost(post._id.ToString(), Global.WALL); long commentsCount = CommentsDAL.countComment(post._id.ToString(), Global.WALL); post.PostWeight += (int)likesCount; post.PostWeight += (int)sharesCount; post.PostWeight += (int)commentsCount; post.PostRank = post.PostWeight + post.AffinityScore; } return(lst); }
public static long countPost(string Atid, int type) { return LikesDAL.countPost(Atid, type); }
public static List<Likes> getLikesTop(int Type, string AtId) { return LikesDAL.getLikesTop( Type, AtId); }
public static LikesBO getLikesByLikesId(string LikesId) { return LikesDAL.getLikesByLikesId(LikesId); }
public static List<Likes> getAllLikesList() { return LikesDAL.getAllLikesList(); }
public static bool youLikes(LikesBO objClass) { return LikesDAL.youLikes(objClass); }
public static void unLikes(LikesBO objClass) { LikesDAL.unLikes(objClass); }
public static void updateLikes(LikesBO objLikes) { LikesDAL.updateLikes(objLikes); }
public static void deleteLikes(string LikesId) { LikesDAL.deleteLikes(LikesId); }
public static void insertLikes(LikesBO objLikes) { LikesDAL.insertLikes(objLikes); }