public ArticleAppService(IArticleDomainService articleDomainService, ICategoryDomainService categoryDomainService) : base() { this._articleDomainService = articleDomainService; this._categoryDomainService = categoryDomainService; MapperConfiguration configuration = new MapperConfiguration(config => { // because tags should be included, and if not include we should not return a empty array [] config.AllowNullCollections = true; config.AddProfile(new AgentMapperProfile()); config.AddProfile(new CategoryMapperProfile()); config.CreateMap <Article, ArticleDto>(); config.CreateMap <Article, ArticleWithIncludeDto>(); config.CreateMap <ArticleTag, Guid>().ConvertUsing(t => t.TagId); config.CreateMap <ArticleCreateDto, Article>(); config.CreateMap <ArticleUpdateDto, ArticleUpdateBo>(); config.CreateMap <ArticleTagsDto, Article>(); config.CreateMap <Article, ArticleTagsDto>(); }); this.Mapper = configuration.CreateMapper(); }
public CategoryCommandHandler(ICategoryDomainService categoryDomainService, IRepository <CategoryBase> repository, IRepository <Product> productRepository) { _categoryDomainService = categoryDomainService; _repository = repository; _productRepository = productRepository; }
public ArticleAppService(IArticleDomainService articleDomainService, ICategoryDomainService categoryDomainService, ITagDomainService tagDomainService, IAgentDomainService agentDomainService) : base() { this._articleDomainService = articleDomainService; this._categoryDomainService = categoryDomainService; this._tagDomainService = tagDomainService; this._agentDomainService = agentDomainService; }
public ArticleAppService(IArticleDomainService articleDomainService, ITagDomainService tagDomainService, IArticleTagRelationDomainService articleTagRelationDomainService, ICategoryDomainService categoryDomainService) : base(articleDomainService) { this._articleDomainService = articleDomainService; this._tagDomainService = tagDomainService; this._articleTagRelationDomainService = articleTagRelationDomainService; this._categoryDomainService = categoryDomainService; }
public CategoryAppService(ICategoryDomainService domainService) : base() { this._domainService = domainService; var configuration = new MapperConfiguration(cfg => { cfg.CreateMap <CategoryDto, Category>(); cfg.CreateMap <Category, CategoryDto>(); }); this.Mapper = configuration.CreateMapper(); }
public BlogDomainService( IUnitOfWorkScopeFactory baseUnitOfWorkScopeFactory, IBlogPostDomainService blogPostDomainService, ICategoryDomainService categoryDomainService, ITagDomainService tagDomainService, IAuthorDomainService authorDomainService) : base(baseUnitOfWorkScopeFactory) { BlogPostDomainService = blogPostDomainService; CategoryDomainService = categoryDomainService; TagDomainService = tagDomainService; AuthorDomainService = authorDomainService; }
public void Publish(Guid articleId) { Article article = _repository.Get(articleId); ICategoryDomainService categoryDomainService = _container.Resolve <ICategoryDomainService>(); Category category = categoryDomainService.Get(article.CategoryId); if (category.IsPublished) { if (article.Status != ArticleStatus.AUDITED) { throw new Exception("Article needs to be audited first."); } article.Status = ArticleStatus.PUBLISHED; } else { throw new Exception("You can only publish article below the public category."); } }
public CategoryAppService(ICategoryDomainService domainService) : base() { this._domainService = domainService; }
public CategoryAppService(ICategoryDomainService categoryDomainService) { this._categoryDomainService = categoryDomainService; }
public CategoryAppService(ICategoryDomainService categoryDomainService, IArticleAppService articleAppService) : base(categoryDomainService) { this._articleAppService = articleAppService; }