Beispiel #1
0
 public UpdateProductCommandHandlerBase(
     IProductRepository productRepository, IMediator mediator, IDomainEventsService domainEventsService)
 {
     ProductRepository   = productRepository;
     Mediator            = mediator;
     DomainEventsService = domainEventsService;
 }
Beispiel #2
0
 public SubjectService(
     IRepository <Subject> repository,
     IDomainEventsService domainEventsService)
 {
     _repository          = repository;
     _domainEventsService = domainEventsService;
 }
Beispiel #3
0
 public InMemorySubscriberService(
     ILogger <InMemorySubscriberService <T> > logger,
     IDomainEventsService domainEventsService)
 {
     _logger = logger;
     _domainEventsService = domainEventsService;
 }
Beispiel #4
0
 public PublishProductCommandHandler(IProductRepository productRepository,
                                     IMediator mediator,
                                     IDomainEventsService domainEventsService)
 {
     _productRepository   = productRepository;
     _mediator            = mediator;
     _domainEventsService = domainEventsService;
 }
Beispiel #5
0
 public DeleteProductPictureCommandHandler(IPictureRepository pictureRepository,
                                           IMediator mediator,
                                           IDomainEventsService domainEventsService)
 {
     _pictureRepository   = pictureRepository;
     _mediator            = mediator;
     _domainEventsService = domainEventsService;
 }
Beispiel #6
0
 public ContactService(
     ILogger <ContactService> logger,
     IDomainEventsService domainEventsService,
     IRepository <Contact> repository)
 {
     _logger = logger;
     _domainEventsService = domainEventsService;
     _repository          = repository;
 }
 public CreateManyProductsCommandHandler(IProductRepository productRepository,
                                         ICategoryRepository categoryRepository,
                                         IManufacturerRepository manufacturerRepository,
                                         IMapper mapper,
                                         IMediator mediator,
                                         IDomainEventsService domainEventsService) : base(productRepository, categoryRepository,
                                                                                          manufacturerRepository, mapper, mediator, domainEventsService)
 {
 }
Beispiel #8
0
 public WordService(
     ILogger <WordService> logger,
     IRepository <Word> wordRepository,
     IDomainEventsService domainEventsService)
 {
     _logger              = logger;
     _wordRepository      = wordRepository;
     _domainEventsService = domainEventsService;
 }
 public ChangeProductPriceCommandHandler(ILogger <ChangeProductPriceCommandHandler> logger,
                                         IProductRepository productRepository,
                                         IDomainEventsService domainEventsService,
                                         IMediator mediator)
 {
     _logger              = logger;
     _productRepository   = productRepository;
     _domainEventsService = domainEventsService;
     _mediator            = mediator;
 }
Beispiel #10
0
 public CreateCategoryCommandHandler(ICategoryRepository categoryRepository,
                                     IMediator mediator,
                                     IDomainEventsService domainEventsService,
                                     IMapper mapper)
 {
     _categoryRepository  = categoryRepository;
     _mediator            = mediator;
     _domainEventsService = domainEventsService;
     _mapper = mapper;
 }
Beispiel #11
0
 public AttachPictureToProductCommandHandler(IProductRepository productRepository,
                                             IPictureRepository pictureRepository,
                                             IMediator mediator,
                                             IDomainEventsService domainEventsService)
 {
     _productRepository   = productRepository;
     _pictureRepository   = pictureRepository;
     _mediator            = mediator;
     _domainEventsService = domainEventsService;
 }
 public CreateManufacturerCommandHandler(IManufacturerRepository manufacturerRepository,
                                         IDomainEventsService domainEventsService,
                                         IMediator mediator,
                                         IMapper mapper)
 {
     _manufacturerRepository = manufacturerRepository;
     _domainEventsService    = domainEventsService;
     _mediator = mediator;
     _mapper   = mapper;
 }
Beispiel #13
0
 public DetachManufacturerPictureCommandHandler(IManufacturerRepository manufacturerRepository,
                                                IMediator mediator,
                                                IDomainEventsService domainEventsService,
                                                IPictureRepository pictureRepository)
 {
     _manufacturerRepository = manufacturerRepository;
     _mediator            = mediator;
     _domainEventsService = domainEventsService;
     _pictureRepository   = pictureRepository;
 }
 public UpdatePictureCommandHandler(IPictureRepository productRepository,
                                    IMapper mapper,
                                    IMediator mediator,
                                    IDomainEventsService domainEventsService)
 {
     _pictureRepository   = productRepository;
     _mapper              = mapper;
     _mediator            = mediator;
     _domainEventsService = domainEventsService;
 }
 public AzureServiceBusSubscriberService(
     ILogger <T> logger,
     IDomainEventsService domainEventsService,
     string connectionStrings,
     string topic,
     string subscription,
     int maxConcurrentCalls = 100)
     : base(logger, domainEventsService, connectionStrings,
            topic, subscription, maxConcurrentCalls)
 {
 }
 public AttachManufacturerPictureCommandHandler(ILogger <AttachManufacturerPictureCommandHandler> logger,
                                                IManufacturerRepository manufacturerRepository,
                                                IPictureRepository pictureRepository,
                                                IMediator mediator, IDomainEventsService domainEventsService)
 {
     _logger = logger;
     _manufacturerRepository = manufacturerRepository;
     _pictureRepository      = pictureRepository;
     _mediator            = mediator;
     _domainEventsService = domainEventsService;
 }
Beispiel #17
0
        public async Task <bool> SaveEntitiesAsync(IDomainEventsService domainEventsService, IMediator mediator, CancellationToken cancellationToken = default)
        {
            StoreDomainEvents(domainEventsService, mediator, cancellationToken);

            OnBeforeSaving();
            await this.BulkSaveChangesAsync(cancellationToken);

            await mediator.DispatchDomainEventsAsync(domainEventsService);

            return(true);
        }
 public DbEventSubscriberService(
     ILogger <DbEventSubscriberService <T> > logger,
     IRepository <PubSubEvent> repository,
     IDomainEventsService domainEventsService,
     string topic,
     int maxConcurrentCalls)
 {
     _logger              = logger;
     _repository          = repository;
     _domainEventsService = domainEventsService;
     _topic = topic;
     _maxConcurrentCalls = maxConcurrentCalls;
 }
Beispiel #19
0
        public static async Task DispatchDomainEventsAsync(this IMediator mediator, IDomainEventsService domainEventsService)
        {
            var domainEvents = domainEventsService.GetDomainEvents();

            var tasks = domainEvents
                        .Select(async domainEvent => {
                await mediator.Publish(domainEvent);
            });

            domainEventsService.ClearDomainEvents();

            await Task.WhenAll(tasks);
        }
Beispiel #20
0
 public EnrollmentService(
     IRepository <Enrollment> repository,
     IStudentService studentService,
     ISubjectService subjectService,
     ILectureTheatreService lectureTheatreService,
     IDomainEventsService domainEventsService)
 {
     _repository            = repository;
     _studentService        = studentService;
     _subjectService        = subjectService;
     _lectureTheatreService = lectureTheatreService;
     _domainEventsService   = domainEventsService;
 }
 protected CreateProductCommandHandlerBase(IProductRepository productRepository,
                                           ICategoryRepository categoryRepository,
                                           IManufacturerRepository manufacturerRepository,
                                           IMapper mapper,
                                           IMediator mediator,
                                           IDomainEventsService domainEventsService)
 {
     ProductRepository       = productRepository;
     _categoryRepository     = categoryRepository;
     _manufacturerRepository = manufacturerRepository;
     _mapper             = mapper;
     Mediator            = mediator;
     DomainEventsService = domainEventsService;
 }
 public EventSubscriberService(
     ILogger <T> logger,
     IDomainEventsService domainEventsService,
     string connectionStrings,
     string topic,
     string subscription,
     int maxConcurrentCalls = 100)
 {
     Topic               = topic;
     Subscription        = subscription;
     MaxConcurrentCalls  = maxConcurrentCalls;
     Logger              = logger;
     DomainEventsService = domainEventsService;
     ConnectionString    = connectionStrings;
 }
 public UpdateProductCommandHandler(IProductRepository productRepository, IMediator mediator, IDomainEventsService domainEventsService) : base(productRepository, mediator, domainEventsService)
 {
 }
Beispiel #24
0
        public void StoreDomainEvents(IDomainEventsService domainEventsService, IMediator mediator, CancellationToken cancellationToken = default)
        {
            var domainEvents = this.GetDomainEvents();

            domainEventsService.AddDomainEvents(domainEvents);
        }