示例#1
0
        /* <summary>Saves a comment by a user on a post</summary>
         * <param name="comment">Post comment model</param>
         * <returns>Nothing</returns>
         * <author>Sveinbjorn</author>
         */
        static public void SaveCommentOnPost(post_comments comment)
        {
            var db = new VERK2015_H17Entities1();

            db.post_comments.Add(comment);
            db.SaveChanges();
        }
示例#2
0
        /* <summary>Counts the bursts on a comment</summary>
         * <param name="postComment">Post comment model</param>
         * <returns>Number of bursts on a comment</returns>
         * <author>Sveinbjorn</author>
         */
        static public List <post_likes> GetBurstCount(post_comments postComment)
        {
            var db         = new VERK2015_H17Entities1();
            var burstCount = (from x in db.post_likes.Where(y => y.posts.C_ID == postComment.C_ID && y.post_burst == true)
                              select x).ToList();

            return(burstCount);
        }