コード例 #1
0
 public BlogController(ILogger <BlogController> logger, IPostService postService, IPageService pageService, ICategoryService categoryService, ITagsService tagsService, ICommentService commentService, IPostFactory postFactory, IPageFactory pageFactory, ICategoryFactory categoryFactory, ITagsFactory tagsFactory, BlogUserManager blogUserManager, IUserFactory userFactory, CommentsSettings commentsSettings, ICaptchaService captchaService, IHttpContextAccessor httpContextAccessor, IIPAddressService iPAddressService, IEmailSender emailSender, IJsonSerializer jsonSerializer, IStringLocalizer <BlogController> stringLocalizer, ISpamService spamService, IEventBus eventBus, BasicSettings basicSettings, IDistributedCache distributedCache)
 {
     _logger              = logger;
     _postService         = postService;
     _pageService         = pageService;
     _categoryService     = categoryService;
     _tagsService         = tagsService;
     _commentService      = commentService;
     _postFactory         = postFactory;
     _pageFactory         = pageFactory;
     _categoryFactory     = categoryFactory;
     _tagsFactory         = tagsFactory;
     _blogUserManager     = blogUserManager;
     _userFactory         = userFactory;
     _commentsSettings    = commentsSettings;
     _captchaService      = captchaService;
     _httpContextAccessor = httpContextAccessor;
     _iPAddressService    = iPAddressService;
     _emailSender         = emailSender;
     _jsonSerializer      = jsonSerializer;
     _stringLocalizer     = stringLocalizer;
     _spamService         = spamService;
     _eventBus            = eventBus;
     _basicSettings       = basicSettings;
     _distributedCache    = distributedCache;
 }
コード例 #2
0
 public CommentsViewComponent(IPostService postService, ICommentService commentService, CommentsSettings commentsSettings, IPostFactory postFactory, ICommentFactory commentFactory)
 {
     _postService      = postService;
     _commentService   = commentService;
     _commentsSettings = commentsSettings;
     _postFactory      = postFactory;
 }
コード例 #3
0
        public PostService(IPostRepository repository,
                           IPostTypeRepository postTypeRepository,
                           ILanguageRepository languageRepository,
                           ICategoryRepository categoryRepository,
                           IPostMetaRepository metaRepository,
                           IPostFactory factory,
                           IDateService dateService,
                           IWebsiteInfo websiteInfo
                           )
        {
            repository.CheckArgumentIsNull(nameof(repository));
            _repository = repository;

            postTypeRepository.CheckArgumentIsNull(nameof(postTypeRepository));
            _postTypeRepository = postTypeRepository;

            languageRepository.CheckArgumentIsNull(nameof(languageRepository));
            _languageRepository = languageRepository;

            categoryRepository.CheckArgumentIsNull(nameof(categoryRepository));
            _categoryRepository = categoryRepository;

            metaRepository.CheckArgumentIsNull(nameof(metaRepository));
            _metaRepository = metaRepository;

            factory.CheckArgumentIsNull();
            _factory = factory;

            dateService.CheckArgumentIsNull(nameof(dateService));
            _dateService = dateService;

            websiteInfo.CheckArgumentIsNull(nameof(websiteInfo));
            _websiteInfo = websiteInfo;
        }
コード例 #4
0
 public BlogRepository(IDBContextFacade dbContext,
                       IDataConverter dataConverter,
                       IPostFactory postFactory)
 {
     _dBContext     = dbContext;
     _dataConverter = dataConverter;
     _postFactory   = postFactory;
     _db            = _dBContext.GetDBContext();
 }
コード例 #5
0
 public PostController(IPostService postService,
                       IPostFactory postFactory,
                       ICategoryService categoryService,
                       ITagsService tagsService)
 {
     _postService     = postService;
     _postFactory     = postFactory;
     _categoryService = categoryService;
     _tagsService     = tagsService;
 }
コード例 #6
0
        public void StartExample()
        {
            _factory = new PackageFactory();
            IPostProduct product1 = _factory.CreateProduct();

            _factory = new MailFactory();
            IPostProduct product2 = _factory.CreateProduct();

            product1.Deliver();
            product2.Deliver();
        }
コード例 #7
0
 public CreatePostCommandHandler(
     ICurrentUser currentUser,
     IPublicUserDomainRepository userRepository,
     IPostDomainRepository postRepository,
     IPostFactory postFactory)
 {
     this.currentUser    = currentUser;
     this.userRepository = userRepository;
     this.postRepository = postRepository;
     this.postFactory    = postFactory;
 }
コード例 #8
0
        public AdminSliderService(
            IPostFactory postFactory,
            IFileFactory fileFactory,
            IPostFileFactory postFileFactory)
        {
            postFactory.CheckArgumentIsNull(nameof(postFactory));
            _postFactory = postFactory;

            fileFactory.CheckArgumentIsNull(nameof(fileFactory));
            _fileFactory = fileFactory;

            postFileFactory.CheckArgumentIsNull(nameof(postFileFactory));
            _postFileFactory = postFileFactory;
        }
コード例 #9
0
ファイル: PostsService.cs プロジェクト: Branimir123/PhotoLife
        public PostsService(
            IRepository <Post> postsRepository,
            IUserService userService,
            IUnitOfWork unitOfWork,
            IPostFactory postFactory,
            ICategoryService categoryService,
            IDateTimeProvider dateTimeProvider)
        {
            if (postsRepository == null)
            {
                throw new ArgumentNullException("postsRepository");
            }

            if (unitOfWork == null)
            {
                throw new ArgumentNullException("unitOfWorks");
            }

            if (userService == null)
            {
                throw new ArgumentNullException("userService");
            }

            if (postFactory == null)
            {
                throw new ArgumentNullException("postFactory");
            }

            if (categoryService == null)
            {
                throw new ArgumentNullException("categoryFactory");
            }

            if (dateTimeProvider == null)
            {
                throw new ArgumentNullException("datetimeProvider");
            }

            this.postsRepository = postsRepository;
            this.userService     = userService;
            this.unitOfWork      = unitOfWork;
            this.postFactory     = postFactory;
            this.categoryService = categoryService;

            this.datetimeProvider = dateTimeProvider;
        }
コード例 #10
0
        public PostService(
            ICreatorsDbContext dbContext,
            ICreatorsDbSaveChangesContext dbSaveChangesContext,
            IPostFactory postFactory,
            ICategoryService categoryService,
            IUserService userService)
        {
            Guard.WhenArgument(dbContext, "dbContext").IsNull().Throw();
            Guard.WhenArgument(dbSaveChangesContext, "dbSaveChangesContext").IsNull().Throw();
            Guard.WhenArgument(postFactory, "postFactory").IsNull().Throw();
            Guard.WhenArgument(categoryService, "categoryService").IsNull().Throw();
            Guard.WhenArgument(userService, "userService").IsNull().Throw();

            this.dbContext            = dbContext;
            this.dbSaveChangesContext = dbSaveChangesContext;

            this.categoryService = categoryService;
            this.userService     = userService;

            this.postFactory = postFactory;
        }
コード例 #11
0
 public PostRepo(IDatabase database, IPostFactory factory) : base(database)
 {
     this.factory = factory;
 }
コード例 #12
0
 public PostService(IEventBus bus, IPostFactory factory, IPostRepo repo)
 {
     this.bus     = bus;
     this.factory = factory;
     this.repo    = repo;
 }
コード例 #13
0
 public PostDomainEventHandler(IPostFactory postFactory, IPostRepository postRepository, IUnitOfWork <ICommunityDbContext> unitOfWork, ILogger <PostDomainEventHandler> logger)
     : base(unitOfWork, logger)
 {
     _postFactory    = postFactory;
     _postRepository = postRepository;
 }