コード例 #1
0
        public static List <tbl_Comment> GetAllCommentByPostId(int Id)
        {
            List <tbl_Comment> _Commentlst = new List <tbl_Comment>();

            using (BloggerEntities db = new BloggerEntities())
            {
                _Commentlst = db.tbl_Comment.Where(c => c.PostId == Id).ToList();
            }
            return(_Commentlst);
        }
コード例 #2
0
        public static List <tbl_Category> GetAllCategory()
        {
            List <tbl_Category> _Categorylst = new List <tbl_Category>();

            using (BloggerEntities db = new BloggerEntities())
            {
                _Categorylst = db.tbl_Category.ToList();
            }
            return(_Categorylst);
        }
コード例 #3
0
        public static List <tbl_Post> GetAllPost()
        {
            List <tbl_Post> _Postlst = new List <tbl_Post>();

            using (BloggerEntities db = new BloggerEntities())
            {
                _Postlst = db.tbl_Post.ToList();
            }
            return(_Postlst);
        }
コード例 #4
0
        public static tbl_Post GetPost(int Id)
        {
            tbl_Post _Post = new tbl_Post();

            using (BloggerEntities db = new BloggerEntities())
            {
                _Post = db.tbl_Post.Where(p => p.Id == Id).FirstOrDefault();
            }
            return(_Post);
        }
コード例 #5
0
        public static string GetAnnouncement()
        {
            string Announcementtext = "";

            using (BloggerEntities db = new BloggerEntities())
            {
                Announcementtext = (from u in db.tbl_Constraints
                                    where u.RelatedId == (int)Constraints.Announcement
                                    select u.DataValues).FirstOrDefault();
            }
            return(Announcementtext);
        }