Exemplo n.º 1
0
 public CategoriesController(KnowledgeBaseContext context, ICategoryRepository categoryRepository, ICategoryFactory categoryFactory, IHttpContextAccessor httpContextAccessor)
 {
     _context             = context;
     _categoryRepository  = categoryRepository;
     _categoryFactory     = categoryFactory;
     _httpContextAccessor = httpContextAccessor;
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
0
        public AddCategoryPresenter(IAddCategoryView view,
                                    ICategoryFactory categoryFactory,
                                    ICategoriesService categoriesServices,
                                    IImageUploader imageUploader) : base(view)
        {
            if (categoriesServices == null)
            {
                throw new ArgumentNullException("Categories service cannot be null.");
            }

            if (categoryFactory == null)
            {
                throw new ArgumentNullException("Category factory cannot be null.");
            }

            if (imageUploader == null)
            {
                throw new ArgumentNullException("Image uploader cannot be null.");
            }

            this.categoriesServices   = categoriesServices;
            this.categoryFactory      = categoryFactory;
            this.imageUploader        = imageUploader;
            this.View.AddingCategory += OnAddingCategory;
            this.View.UploadingImage += OnUploadingImage;
        }
Exemplo n.º 4
0
 public ArticleFactory(IHttpContextAccessor httpContextAccessor, IUserRepository userRepository, ICategoryFactory categoryFactory, ICategoryRepository categoryRepository, KnowledgeBaseContext context)
 {
     _httpContextAccessor = httpContextAccessor;
     _userRepository      = userRepository;
     _categoryFactory     = categoryFactory;
     _categoryRepository  = categoryRepository;
     _context             = context;
 }
Exemplo n.º 5
0
 public CategoriesNewCodeController(KnowledgeBaseContext context, IHttpContextAccessor httpContextAccessor, ICategoryFactory categoryFactory, ICategoryRepository categoryRepository, IActivityRepository activityRepository)
 {
     _context             = context;
     _httpContextAccessor = httpContextAccessor;
     _categoryFactory     = categoryFactory;
     _categoryRepository  = categoryRepository;
     _activityRepository  = activityRepository;
 }
 public CategoryController(
     ICategoryFactory categoryFactory
     )
 {
     if (categoryFactory == null)
         throw new ArgumentNullException("categoryFactory");
     this.categoryFactory = categoryFactory;
 }
 public void OneTimeTearDown()
 {
     _noteFactory        = null;
     _subscriberFactory  = null;
     _categoryFactory    = null;
     _categoryRepository = null;
     _mapper             = null;
 }
Exemplo n.º 8
0
 public MovieService(IContext context, IRequestMessageProvider requestMessageProvider, ICustomException customException,
                     IMovieFactory movieFactory, ICategoryFactory categoryFactory, IPersonFactory personFactory)
     : base(context, requestMessageProvider, customException)
 {
     _movieFactory    = movieFactory;
     _categoryFactory = categoryFactory;
     _personFactory   = personFactory;
 }
 public void OneTimeSetup()
 {
     // ARRANGE
     _noteFactory        = Substitute.For <INoteFactory>();
     _subscriberFactory  = Substitute.For <ISubscriberFactory>();
     _categoryFactory    = Substitute.For <ICategoryFactory>();
     _categoryRepository = Substitute.For <ICategoryRepository>();
     _mapper             = Substitute.For <IMapper>();
 }
Exemplo n.º 10
0
        public static ICategory Convert(IDictionary <string, object> line, ICategoryFactory categoryFactory)
        {
            var id          = (long)line["id"];
            var name        = line["name"].ToString();
            var description = line["description"].ToString();

            var account = categoryFactory.CreateCategory(name, description, id, null);

            return(account);
        }
Exemplo n.º 11
0
 public CategoryController(
     ICategoryFactory categoryFactory
     )
 {
     if (categoryFactory == null)
     {
         throw new ArgumentNullException("categoryFactory");
     }
     this.categoryFactory = categoryFactory;
 }
Exemplo n.º 12
0
        public void Setup()
        {
            _accountFactory     = new RegularAccountFactory();
            _categoryFactory    = new RegularCategoryFactory();
            _accountStorage     = new CachedAccountStorage(new SqLiteAccountStorage(_accountFactory));
            _categoryStorage    = new CachedCategoryStorage(new SqLiteCategoryStorage(_categoryFactory));
            _transactionFactory = new RegularQuickTransactionFactory();
            _storage            = new CachedQuickTransactionStorage(new SqLiteQuickTransactionStorage(_transactionFactory, _accountStorage, _categoryStorage));
            _storage.DeleteAllData();

            _transaction = CreateTransaction();
        }
Exemplo n.º 13
0
 public NoteTaker(
     INoteFactory noteFactory,
     ISubscriberFactory subscriberFactory,
     ICategoryFactory categoryFactory,
     ICategoryRepository categoryRepository,
     IMapper mapper
     )
 {
     _noteFactory        = noteFactory ?? throw new ArgumentNullException(nameof(noteFactory));
     _subscriberFactory  = subscriberFactory ?? throw new ArgumentNullException(nameof(subscriberFactory));
     _categoryFactory    = categoryFactory ?? throw new ArgumentNullException(nameof(categoryFactory));
     _categoryRepository = categoryRepository ?? throw new ArgumentNullException(nameof(categoryRepository));
     _mapper             = mapper ?? throw new ArgumentNullException(nameof(mapper));
 }
Exemplo n.º 14
0
        public CategoryService(
            ICategoryRepository repo,
            ICategoryFactory factory,
            IUserContext userContext
            )
        {
            repo.CheckArgumentIsNull();
            _repo = repo;

            factory.CheckArgumentIsNull();
            _factory = factory;

            userContext.CheckArgumentIsNull();
            _userContext = userContext;
        }
Exemplo n.º 15
0
 public CategoryService(
     ICategoryFactory factory,
     ICategoryRepository repository,
     IProductRepository productRepository,
     IPictureRepository pictureRepository,
     IProductService productService,
     ICustomMapper customMapper)
 {
     this.factory            = factory;
     this.categoryRepository = repository;
     this.productRepository  = productRepository;
     this.pictureRepository  = pictureRepository;
     this.productService     = productService;
     this.customMapper       = customMapper;
 }
Exemplo n.º 16
0
 public BillService(IBillRepository billRepository,
                    ISupplierRepository supplierRepository,
                    ICategoryRepository categoryRepository,
                    IBillFactory billFactory,
                    IAmountFactory amountFactory,
                    ISupplierFactory supplierFactory,
                    ICategoryFactory categoryFactory)
 {
     _billRepository     = billRepository;
     _supplierRepository = supplierRepository;
     _categoryRepository = categoryRepository;
     _billFactory        = billFactory;
     _amountFactory      = amountFactory;
     _supplierFactory    = supplierFactory;
     _categoryFactory    = categoryFactory;
 }
Exemplo n.º 17
0
        public void Setup()
        {
            _factory = new RegularCategoryFactory();
            _storage = new SqLiteCategoryStorage(_factory);
            _storage.DeleteAllData();

            {
                var name        = "Test Category";
                var description = "Test Description";
                _category = _factory.CreateCategory(name, description, 1, null);
            }


            {
                var name        = $"Child {_category.Name} Category";
                var description = $"Child {_category.Name} Description";
                _childCategory = _factory.CreateCategory(name, description, 2, _category);
            }
        }
Exemplo n.º 18
0
        public CategoryService(IRepository <Category> repository, IUnitOfWork unitOfWork, ICategoryFactory factory)
        {
            if (repository == null)
            {
                throw new ArgumentNullException("repository cannot be null");
            }

            if (factory == null)
            {
                throw new ArgumentNullException("factory cannot be null");
            }

            if (unitOfWork == null)
            {
                throw new ArgumentNullException("unit of work cannot be null");
            }

            this.repository = repository;
            this.unitOfWork = unitOfWork;
            this.factory    = factory;
        }
Exemplo n.º 19
0
        public CategoryService(IRepository <Category> categoryRepository, IUnitOfWork unitOfWork, ICategoryFactory categoryFactory)
        {
            if (categoryRepository == null)
            {
                throw new ArgumentNullException("categoryRepository");
            }

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

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

            this.categoryRepository = categoryRepository;
            this.unitOfWork         = unitOfWork;
            this.categoryFactory    = categoryFactory;
        }
Exemplo n.º 20
0
 public CategoryManager(ICategoryFactory factory, IValidator <Category> validator, IExceptionHandler handler)
 {
     _factory   = factory;
     _validator = validator;
     _handler   = handler;
 }
Exemplo n.º 21
0
 public SqLiteCategoryStorage(ICategoryFactory categoryFactory) : base(categoryFactory)
 {
 }
Exemplo n.º 22
0
 public PostFactory(IMapper mapper, IUserFactory userFactory, ICategoryFactory categoryFactory)
 {
     _mapper          = mapper;
     _userFactory     = userFactory;
     _categoryFactory = categoryFactory;
 }
Exemplo n.º 23
0
 public MemoryCategoryStorage(ICategoryFactory categoryFactory) : base(categoryFactory)
 {
 }
 public CategoryController(ICategoryService categoryService, ICategoryFactory categoryFactory)
 {
     _categoryService = categoryService;
     _categoryFactory = categoryFactory;
 }
Exemplo n.º 25
0
 public CategoryService(ICategoryRepository categoryRepository,
                        ICategoryFactory categoryFactory)
 {
     _categoryRepository = categoryRepository;
     _categoryFactory    = categoryFactory;
 }
Exemplo n.º 26
0
 public CategoryManager(ICategoryFactory factory)
 {
     Factory   = factory;
     Categorie = new List <ICategory>();
 }
Exemplo n.º 27
0
 protected CategoryStorageBase(ICategoryFactory categoryFactory)
 {
     CategoryFactory = categoryFactory;
 }