public PostController()
 {
     _context        = new SportboardDbContext();
     _unitOfWork     = new UnitOfWork(_context);
     _postRepository = new PostRepository(_context);
     _feedRepository = new FeedRepository(_context);
 }
 public UserNotificationController()
 {
     _context    = new SportboardDbContext();
     _unitOfWork = new UnitOfWork(_context);
     _userNotificationRepository = new UserNotificationRepository(_context);
     _bLLUserNotif = new BLLUserNotifications(_unitOfWork, _userNotificationRepository);
 }
 public AdminController()
 {
     _context           = new ApplicationDbContext();
     _dbContext         = new SportboardDbContext();
     _unitOfWork        = new UnitOfWork(_dbContext);
     _requestRepository = new DeletionRequestRepository(_dbContext);
 }
Example #4
0
        public void GetUserHistory(string id)
        {
            using (var context = new SportboardDbContext())
            {
                _feeds = context.Feed
                         .Include("Image")
                         .Where(f => f.UserId == id)
                         .OrderByDescending(f => f.CreatedOn)
                         .ToList();

                _posts = context.Post
                         .Include("Feed")
                         .Include("Image")
                         .Where(p => p.UserId == id)
                         .OrderByDescending(p => p.PostDate)
                         .ToList();

                _comments = context.Comment
                            .Include("Post")
                            .Include("CommentUpvoteUserIds")
                            .Include("CommentDownVoteUserIds")
                            .Where(c => c.UserId == id)
                            .OrderByDescending(c => c.CreatedOn)
                            .ToList();
            }
        }
 public CommentController()
 {
     _context           = new SportboardDbContext();
     _unitOfWork        = new UnitOfWork(_context);
     _postRepository    = new PostRepository(_context);
     _commentRepository = new CommentRepository(_context);
     _userRepository    = new UserRepository(_context);
 }
Example #6
0
 public ManageController()
 {
     _context = new SportboardDbContext();
     _uow     = new UnitOfWork(_context);
     _userPreferenceRepository  = new UserPreferenceRepository(_context);
     _userRepository            = new UserRepository(_context);
     _imageRepository           = new ImageRepository(_context);
     _deletionRequestRepository = new DeletionRequestRepository(_context);
 }
 public FeedController()
 {
     _context                   = new SportboardDbContext();
     _unitOfWork                = new UnitOfWork(_context);
     _imageRepository           = new ImageRepository(_context);
     _feedRepository            = new FeedRepository(_context);
     _postRepository            = new PostRepository(_context);
     _userPreferenceRepository  = new UserPreferenceRepository(_context);
     _userRepository            = new UserRepository(_context);
     _deletionRequestRepository = new DeletionRequestRepository(_context);
 }
 public ValidPostConstraint()
 {
     _context        = new SportboardDbContext();
     _postRepository = new PostRepository(_context);
 }
Example #9
0
 public CommentController()
 {
     _context           = new SportboardDbContext();
     _commentRepository = new CommentRepository(_context);
 }
 public ImageRepository(SportboardDbContext context) : base(context)
 {
 }
 public CommentRepository(SportboardDbContext context)
     : base(context)
 {
 }
 public UserPreferenceRepository(SportboardDbContext context) : base(context)
 {
 }
Example #13
0
 public PostRepository(SportboardDbContext context)
     : base(context)
 {
 }
Example #14
0
 public UserNotificationRepository(SportboardDbContext context)
     : base(context)
 {
 }
 public FeedRepository(SportboardDbContext context)
     : base(context)
 {
 }
Example #16
0
 public ValidFeedConstraint()
 {
     _context        = new SportboardDbContext();
     _feedRepository = new FeedRepository(_context);
 }
Example #17
0
 public DeletionRequestRepository(SportboardDbContext context) : base(context)
 {
 }
Example #18
0
 public Repository(SportboardDbContext context)
 {
     Context = context;
     _dbSet  = Context.Set <TEntity>();
 }
Example #19
0
 public UserRepository(SportboardDbContext context) : base(context)
 {
 }