예제 #1
0
 public PostInteractService(IFavoriteDao favoriteDao, ICommentDao commentDao, IPostDao postDao, IUserDao userDao)
 {
     this.favoriteDao = favoriteDao;
     this.commentDao  = commentDao;
     this.postDao     = postDao;
     this.userDao     = userDao;
 }
예제 #2
0
 public SubsController(IContextService contextService,
     ISubDao subDao,
     IMapper mapper,
     ICommandBus commandBus,
     IUserContext userContext,
     IPostDao postDao,
     IVoteDao voteDao,
     ICommentDao commentDao,
     IPermissionDao permissionDao,
     ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder,
     ICommentTreeContextBuilder commentTreeContextBuilder,
     IPostWrapper postWrapper,
     ISubWrapper subWrapper,
     ICommentWrapper commentWrapper)
 {
     _contextService = contextService;
     _subDao = subDao;
     _mapper = mapper;
     _commandBus = commandBus;
     _userContext = userContext;
     _postDao = postDao;
     _voteDao = voteDao;
     _commentDao = commentDao;
     _permissionDao = permissionDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
     _commentTreeContextBuilder = commentTreeContextBuilder;
     _postWrapper = postWrapper;
     _subWrapper = subWrapper;
     _commentWrapper = commentWrapper;
 }
예제 #3
0
 public PostWrapper(IPostDao postDao, IMembershipService membershipService, ISubDao subDao, IVoteDao voteDao)
 {
     _postDao = postDao;
     _membershipService = membershipService;
     _subDao = subDao;
     _voteDao = voteDao;
 }
예제 #4
0
        public BlogsStorage(string dbId, int tenant)
        {
            _db     = new DbManager(dbId);
            _tenant = tenant;

            _blogDao = new DbBlogDao(_db, _tenant);
            _postDao = new DbPostDao(_db, _tenant);
        }
예제 #5
0
        public BlogsStorage(string dbId,int tenant)
        {
            _db = new DbManager(dbId);
            _tenant = tenant;

            _blogDao = new DbBlogDao(_db, _tenant);
            _postDao = new DbPostDao(_db, _tenant); 
        }
예제 #6
0
 public NewFeedService(IUserDao userDao, IPostDao postDao, ICommentDao commentDao, IFavoriteDao favoriteDao,
                       IRelationshipService relationshipService)
 {
     this.userDao             = userDao;
     this.postDao             = postDao;
     this.commentDao          = commentDao;
     this.favoriteDao         = favoriteDao;
     this.relationshipService = relationshipService;
 }
예제 #7
0
 public CommentWrapper(ICommentDao commentDao, IMembershipService membershipService, ISubDao subDao, IPostDao postDao, IPermissionDao permissionDao, IVoteDao voteDao)
 {
     _commentDao = commentDao;
     _membershipService = membershipService;
     _subDao = subDao;
     _postDao = postDao;
     _permissionDao = permissionDao;
     _voteDao = voteDao;
 }
예제 #8
0
        public DataAccess(
            IPostDao postDao,
            ICommentDao commentDao)
        {
            PostDao = postDao ??
                      throw new ArgumentNullException($"{nameof(postDao)}");

            CommentDao = commentDao ??
                         throw new ArgumentNullException($"{nameof(commentDao)}");
        }
예제 #9
0
        public static Post Get(this IPostDao pDao, Guid id, bool withTags, bool withCommentsCount)
        {
            var list = pDao.Select(id, null, null, true, withTags, withCommentsCount);

            if (list.Count == 1)
            {
                return(list[0]);
            }
            else
            {
                return(null);
            }
        }
예제 #10
0
 public PostWrapper(IPostDao postDao,
                    IMembershipService membershipService,
                    ISubDao subDao,
                    IVoteDao voteDao,
                    IPermissionDao permissionDao,
                    IReportDao reportDao)
 {
     _postDao           = postDao;
     _membershipService = membershipService;
     _subDao            = subDao;
     _voteDao           = voteDao;
     _permissionDao     = permissionDao;
     _reportDao         = reportDao;
 }
예제 #11
0
 public PostWrapper(IPostDao postDao, 
     IMembershipService membershipService, 
     ISubDao subDao, 
     IVoteDao voteDao,
     IPermissionDao permissionDao,
     IReportDao reportDao)
 {
     _postDao = postDao;
     _membershipService = membershipService;
     _subDao = subDao;
     _voteDao = voteDao;
     _permissionDao = permissionDao;
     _reportDao = reportDao;
 }
예제 #12
0
 public PostsController(ISubDao subDao,
     ISubWrapper subWrapper,
     IPostDao postDao,
     IPostWrapper postWrapper,
     IUserContext userContext,
     ICommandBus commandBus,
     ILogger<PostsController> logger)
 {
     _subDao = subDao;
     _subWrapper = subWrapper;
     _postDao = postDao;
     _postWrapper = postWrapper;
     _userContext = userContext;
     _commandBus = commandBus;
     _logger = logger;
 }
예제 #13
0
        public static List <Typle <Post, Typle <int, int> > > GetCommentsStatistic(this IPostDao pDao, List <Post> posts, Guid forUser)
        {
            List <Guid> ids = posts.ConvertAll(p => p.ID);
            var         dic = pDao.GetCommentsStatistic(ids, forUser);

            var result = new List <Typle <Post, Typle <int, int> > >(posts.Count);

            foreach (var post in posts)
            {
                result.Add(new Typle <Post, Typle <int, int> >
                {
                    Value1 = post,
                    Value2 = dic[post.ID]
                });
            }

            return(result);
        }
예제 #14
0
 public UsersController(IMembershipService membershipService,
     ISubDao subDao,
     IModerationDao moderationDao,
     IKarmaDao karmaDao,
     ICommentDao commentDao,
     ICommentWrapper commentWrapper,
     IPostDao postDao,
     IPostWrapper postWrapper,
     IUserContext userContext,
     IContextService contextService)
 {
     _membershipService = membershipService;
     _subDao = subDao;
     _moderationDao = moderationDao;
     _karmaDao = karmaDao;
     _commentDao = commentDao;
     _commentWrapper = commentWrapper;
     _postDao = postDao;
     _postWrapper = postWrapper;
     _userContext = userContext;
     _contextService = contextService;
 }
예제 #15
0
 public ReportsController(ILogger <ReportsController> logger,
                          ICommandBus commandBus,
                          IUserContext userContext,
                          ISubDao subDao,
                          ISubWrapper subWrapper,
                          IPermissionDao permissionDao,
                          IPostDao postDao,
                          IPostWrapper postWrapper,
                          ICommentDao commentDao,
                          ICommentWrapper commentWrapper)
 {
     _logger         = logger;
     _commandBus     = commandBus;
     _userContext    = userContext;
     _subDao         = subDao;
     _subWrapper     = subWrapper;
     _permissionDao  = permissionDao;
     _postDao        = postDao;
     _postWrapper    = postWrapper;
     _commentDao     = commentDao;
     _commentWrapper = commentWrapper;
 }
예제 #16
0
 public UsersController(IMembershipService membershipService,
                        ISubDao subDao,
                        IModerationDao moderationDao,
                        IKarmaDao karmaDao,
                        ICommentDao commentDao,
                        ICommentWrapper commentWrapper,
                        IPostDao postDao,
                        IPostWrapper postWrapper,
                        IUserContext userContext,
                        IContextService contextService)
 {
     _membershipService = membershipService;
     _subDao            = subDao;
     _moderationDao     = moderationDao;
     _karmaDao          = karmaDao;
     _commentDao        = commentDao;
     _commentWrapper    = commentWrapper;
     _postDao           = postDao;
     _postWrapper       = postWrapper;
     _userContext       = userContext;
     _contextService    = contextService;
 }
예제 #17
0
 public ReportsController(ILogger<ReportsController> logger,
     ICommandBus commandBus,
     IUserContext userContext,
     ISubDao subDao,
     ISubWrapper subWrapper,
     IPermissionDao permissionDao,
     IPostDao postDao,
     IPostWrapper postWrapper,
     ICommentDao commentDao,
     ICommentWrapper commentWrapper)
 {
     _logger = logger;
     _commandBus = commandBus;
     _userContext = userContext;
     _subDao = subDao;
     _subWrapper = subWrapper;
     _permissionDao = permissionDao;
     _postDao = postDao;
     _postWrapper = postWrapper;
     _commentDao = commentDao;
     _commentWrapper = commentWrapper;
 }
예제 #18
0
 public SubsController(IContextService contextService,
                       ISubDao subDao,
                       IMapper mapper,
                       ICommandBus commandBus,
                       IUserContext userContext,
                       IPostDao postDao,
                       IVoteDao voteDao,
                       ICommentDao commentDao,
                       IPermissionDao permissionDao,
                       ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder,
                       ICommentTreeContextBuilder commentTreeContextBuilder,
                       IPostWrapper postWrapper,
                       ISubWrapper subWrapper,
                       ICommentWrapper commentWrapper,
                       IMembershipService membershipService,
                       ISettingsProvider <SubSettings> subSettings,
                       ISubActivityDao subActivityDao,
                       IModerationDao moderationDao)
 {
     _contextService = contextService;
     _subDao         = subDao;
     _mapper         = mapper;
     _commandBus     = commandBus;
     _userContext    = userContext;
     _postDao        = postDao;
     _voteDao        = voteDao;
     _commentDao     = commentDao;
     _permissionDao  = permissionDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
     _commentTreeContextBuilder   = commentTreeContextBuilder;
     _postwrapper        = postWrapper;
     _subwrapper         = subWrapper;
     _commentWrapper     = commentWrapper;
     _membershiipService = membershipService;
     _subSettings        = subSettings;
     _subActivityDao     = subActivityDao;
     _moderationDao      = moderationDao;
 }
예제 #19
0
 public SubsController(IContextService contextService,
     ISubDao subDao,
     IMapper mapper,
     ICommandBus commandBus,
     IUserContext userContext,
     IPostDao postDao,
     IVoteDao voteDao,
     ICommentDao commentDao,
     IPermissionDao permissionDao,
     ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder,
     ICommentTreeContextBuilder commentTreeContextBuilder,
     IPostWrapper postWrapper,
     ISubWrapper subWrapper,
     ICommentWrapper commentWrapper,
     IMembershipService membershipService,
     ISettingsProvider<SubSettings> subSettings,
     ISubActivityDao subActivityDao,
     IModerationDao moderationDao)
 {
     _contextService = contextService;
     _subDao = subDao;
     _mapper = mapper;
     _commandBus = commandBus;
     _userContext = userContext;
     _postDao = postDao;
     _voteDao = voteDao;
     _commentDao = commentDao;
     _permissionDao = permissionDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
     _commentTreeContextBuilder = commentTreeContextBuilder;
     _postWrapper = postWrapper;
     _subWrapper = subWrapper;
     _commentWrapper = commentWrapper;
     _membershipService = membershipService;
     _subSettings = subSettings;
     _subActivityDao = subActivityDao;
     _moderationDao = moderationDao;
 }
예제 #20
0
 public PostsController(ISubDao subDao,
     ISubWrapper subWrapper,
     IPostDao postDao,
     IPostWrapper postWrapper,
     IUserContext userContext,
     ICommandBus commandBus,
     IContextService contextService,
     ICommentTreeContextBuilder commentTreeContextBuilder,
     ICommentDao commentDao,
     ISubActivityDao subActivityDao,
     ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder)
 {
     _subDao = subDao;
     _subWrapper = subWrapper;
     _postDao = postDao;
     _postWrapper = postWrapper;
     _userContext = userContext;
     _commandBus = commandBus;
     _contextService = contextService;
     _commentTreeContextBuilder = commentTreeContextBuilder;
     _commentDao = commentDao;
     _subActivityDao = subActivityDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
 }
예제 #21
0
 public PostsController(ISubDao subDao,
                        ISubWrapper subWrapper,
                        IPostDao postDao,
                        IPostWrapper postWrapper,
                        IUserContext userContext,
                        ICommandBus commandBus,
                        IContextService contextService,
                        ICommentTreeContextBuilder commentTreeContextBuilder,
                        ICommentDao commentDao,
                        ISubActivityDao subActivityDao,
                        ICommentNodeHierarchyBuilder commentNodeHierarchyBuilder)
 {
     _subDao                      = subDao;
     _subWrapper                  = subWrapper;
     _postDao                     = postDao;
     _postWrapper                 = postWrapper;
     _userContext                 = userContext;
     _commandBus                  = commandBus;
     _contextService              = contextService;
     _commentTreeContextBuilder   = commentTreeContextBuilder;
     _commentDao                  = commentDao;
     _subActivityDao              = subActivityDao;
     _commentNodeHierarchyBuilder = commentNodeHierarchyBuilder;
 }
예제 #22
0
 /// <summary>
 /// builder for injection
 /// </summary>
 /// <param name="repo"></param>
 public PostMananger(IPostDao repo)
 {
     Repo = repo;
 }
 public PostPresentationService(IPostDao postDao, ICommentDao commentDao, ILogger logger)
 {
     this.postDao    = postDao;
     this.commentDao = commentDao;
     this.logger     = logger;
 }
예제 #24
0
 public ProfileService(IUserDao userDao, IPostDao postDao, IRelationshipDao relationShipDao)
 {
     this.userDao         = userDao;
     this.postDao         = postDao;
     this.relationShipDao = relationShipDao;
 }
예제 #25
0
 public static Post Get(this IPostDao pDao, Guid id)
 {
     return(Get(pDao, id, true, false));
 }
예제 #26
0
 public static List <Post> GetUserPostsDesc(this IPostDao pDao, Guid userId, string tag, int?from, int?count)
 {
     return(pDao.Select(null, null, userId, tag, true, false, from, count, true, true));
 }
예제 #27
0
 public static int GetPostsByTagCount(this IPostDao pDao, string tag)
 {
     return(pDao.GetCount(null, null, null, tag));
 }
예제 #28
0
 public static int GetAllPostsCount(this IPostDao pDao)
 {
     return(pDao.GetCount(null, null, null, null));
 }
예제 #29
0
 public BlogsStorage(string dbId, int tenant)
 {
     _db      = DbManager.FromHttpContext(dbId);
     _tenant  = tenant;
     _postDao = new DbPostDao(_db, _tenant);
 }
예제 #30
0
 public static int GetUserPostsCount(this IPostDao pDao, Guid userId, string tag)
 {
     return(pDao.GetCount(null, null, userId, tag));
 }
예제 #31
0
 public static List <Post> GetPostsByTagDesc(this IPostDao pDao, string tag, int?from, int?count)
 {
     return(pDao.Select(null, null, null, tag, true, false, from, count, true, true));
 }
예제 #32
0
 public static List <Post> GetAllPostsDesc(this IPostDao pDao, int?from, int?count)
 {
     return(pDao.Select(null, null, null, null, true, false, from, count, true, true));
 }