Пример #1
0
 public Repo(dbIdentity db)
 {
     this._db = db;
     table    = _db.Set <T>();
 }
 public PostsController(dbIdentity context)
 {
     _context = context;
 }
Пример #3
0
        public CommentsController(dbIdentity context)
        {
            _context = context;

            List <CommentPostVM> CommentPostList = new List <CommentPostVM>
            {
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'L', StatusId = 001
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'L', StatusId = 002
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'L', StatusId = 003
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'L', StatusId = 004
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'L', StatusId = 005
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'L', StatusId = 006
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'L', StatusId = 007
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'D', StatusId = 008
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'D', StatusId = 009
                },
                new CommentPostVM {
                    Id = 1, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now, ReactStatus = 'D', StatusId = 010
                },



                new CommentPostVM {
                    Id = 2, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 2", CommentBy = "User2", CommentedDate = DateTime.Now
                },
                new CommentPostVM {
                    Id = 3, PostID = 1, PostMessage = "Post 1", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-1), CommentMessage = "Comment 3", CommentBy = "User3", CommentedDate = DateTime.Now
                },

                new CommentPostVM {
                    Id = 4, PostID = 2, PostMessage = "Post 2", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-2), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now
                },
                new CommentPostVM {
                    Id = 5, PostID = 2, PostMessage = "Post 2", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-2), CommentMessage = "Comment 2", CommentBy = "User2", CommentedDate = DateTime.Now
                },
                new CommentPostVM {
                    Id = 6, PostID = 2, PostMessage = "Post 2", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-2), CommentMessage = "Comment 3", CommentBy = "User3", CommentedDate = DateTime.Now
                },
                new CommentPostVM {
                    Id = 7, PostID = 2, PostMessage = "Post 2", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-2), CommentMessage = "Comment 3", CommentBy = "User3", CommentedDate = DateTime.Now
                },

                new CommentPostVM {
                    Id = 8, PostID = 3, PostMessage = "Post 3", PostBy = "Admin", PostedDate = DateTime.Now.AddDays(-3), CommentMessage = "Comment 1", CommentBy = "User1", CommentedDate = DateTime.Now
                },
            };

            _CommentPostList = CommentPostList;
        }