protected CommandHandler(ArchDbContext architectureContext, IDomainNotification notifications, IEventRepository eventRepository, EventSourcingContext eventSourcingContext) { _architectureContext = architectureContext; _notifications = notifications; _eventRepository = eventRepository; _eventSourcingContext = eventSourcingContext; }
public ApplicationService(IApplicationRepository applicationRepository, ISsoService ssoService, IMapper mapper, IDomainNotification domainNotification) { _applicationRepository = applicationRepository; _ssoService = ssoService; _mapper = mapper; _domainNotification = domainNotification; }
public async Task PublishDomainNotificationAsync <TAggregateRootId>(IDomainNotification <TAggregateRootId> notification, CancellationToken token = default) { notification.WithEventingContext(_domainEvent); await _domainNotificationPublisher.PublishAsync(notification, token); }
public TransactionService(IAccountRepository accountRepository, IUnitOfWork unitOfWork, IDomainNotification notification) { _accountRepository = accountRepository; _unitOfWork = unitOfWork; _notification = notification; }
public CustomerController( IDomainNotification notifications, IProcessor processor, IEventRepository eventRepository) : base(notifications) { _processor = processor; _eventRepository = eventRepository; }
public CustomerController( IProcessor processor, IDomainNotification notifications, AuthService authService) : base(notifications) { _processor = processor; _authService = authService; }
public IEnumerable <IDomainNotification> Handle(IDomainNotification evt) { this.updatedReadModels.Clear(); MethodExecutor.ExecuteMethod(this, evt.Event); return(this.updatedReadModels); }
public CustomerCommandHandler( ArchDbContext architectureContext, IDomainNotification notifications, IEventRepository eventRepository, EventSourcingContext eventSourcingContext) : base(architectureContext, notifications, eventRepository, eventSourcingContext) { _architectureContext = architectureContext; }
public CustomerService(ICustomerRepository customerRepository, IViaCEPService viaCEPService, IDomainNotification domainNotification, IUnitOfWork unitOfWork, IMapper mapper) { _customerRepository = customerRepository; _viaCEPService = viaCEPService; _domainNotification = domainNotification; _unitOfWork = unitOfWork; _mapper = mapper; }
public void SetUp() { _unitOfWork = new Mock <IUnitOfWork>(); _usuarioRepository = new Mock <IUsuarioRepository>(); _domainNotification = new DomainNotification(); _usuarioService = new UsuarioService(_usuarioRepository.Object, _unitOfWork.Object, _domainNotification); }
internal static IDomainNotification WithEventingContext <TAggregateRootId>(this IDomainNotification <TAggregateRootId> notification, IDomainEvent @event) { notification.ApplicationCommandId = @event.ApplicationCommandId; notification.ApplicationCommandType = @event.ApplicationCommandType; notification.ApplicationCommandReplyScheme = @event.ApplicationCommandReplyScheme; return(notification); }
public CourseService(IMapper mapper, IDomainNotification domainNotification, IUnitOfWork unitOfWork, ICategoryRepository categoryRepository, ICourseRepository courseRepository) { _mapper = mapper; _domainNotification = domainNotification; _unitOfWork = unitOfWork; _categoryRepository = categoryRepository; _courseRepository = courseRepository; }
public ExchangeRateService( IForeignExchangeRatesService foreignExchangeRatesService, IDomainNotification domainNotification, IOptions <ExchangeRatePerSegment> exchangeRatePerSegment) { _foreignExchangeRatesService = foreignExchangeRatesService; _domainNotification = domainNotification; _exchangeRatePerSegment = exchangeRatePerSegment.Value; }
public CustomerCommandHandler( ArchContext context, IDomainNotification notifications, EventSourcingContext eventSourcingContext) : base(context, eventSourcingContext, notifications) { _context = context; _eventSourcingContext = eventSourcingContext; }
public virtual void Publish(IDomainNotification evt) { if (this.onPublish != null) { this.onPublish(evt); } this.Events.Add(evt); }
public ProductCommandHandler(IUnitOfWork uow, IDomainNotification notifications, IProductRepository productRepository, IProductQuestionAnswerRepository productQuestionAnswerRepository, IProductImageRepository productImageRepository) : base(uow, notifications) { _productQuestionAnswerRepository = productQuestionAnswerRepository; _productRepository = productRepository; _productImageRepository = productImageRepository; }
public CommandHandlerBase( ArchContext context, EventSourcingContext eventSourcingContext, IDomainNotification notifications) { _context = context; _notifications = notifications; _eventSourcingContext = eventSourcingContext; }
public ListCommandHandler( ArchDbContext architectureContext, EventSourcingContext eventSourcingContext, IDomainNotification notifications) { _architectureContext = architectureContext; _eventSourcingContext = eventSourcingContext; _notifications = notifications; }
public AuthorizationCommandHandler(IUnitOfWork uow, IDomainNotification notifications, JwtTokenConfig jwtTokenConfig, IUserRepository userRepository, IPasswordHasherService passwordHasherService, IShopperRepository shopperRepository) : base(uow, notifications) { _jwtTokenConfig = jwtTokenConfig; _userRepository = userRepository; _passwordHasherService = passwordHasherService; _shopperRepository = shopperRepository; }
protected CommandHandler( ArchCoreContext architectureContext, IDomainNotification notifications, IEventRepository eventRepository, EventSourcingCoreContext eventSourcingContext, AuthService authService) { _architectureContext = architectureContext; _notifications = notifications; _eventRepository = eventRepository; _eventSourcingContext = eventSourcingContext; _authService = authService; }
public ShopperCommandHandler(IUnitOfWork uow, IDomainNotification notifications, IUserRepository userRepository, IPasswordHasherService passwordHasherService, IShopperRepository shopperRepository, IShopperAddressRepository shopperAddressRepository) : base(uow, notifications) { _userRepository = userRepository; _passwordHasherService = passwordHasherService; _shopperRepository = shopperRepository; _shopperAddressRepository = shopperAddressRepository; }
public OrderController ( IDomainNotification domainNotification, IOrderService orderService, IMapper mapper ) : base(domainNotification) { _orderService = orderService; _mapper = mapper; }
public OrderCommandHandler( ArchCoreContext architectureContext, IDomainNotification notifications, IEventRepository eventRepository, EventSourcingCoreContext eventSourcingContext, AuthService authService) : base(architectureContext, notifications, eventRepository, eventSourcingContext, authService) { _architectureContext = architectureContext; }
public void Publish <TAggregateRootId>(IDomainNotification <TAggregateRootId> notification) { if (notification == null) { throw new ArgumentNullException(nameof(notification)); } notification.Topic = _options.Topic; _messagePublisher.Publish(notification); }
public AccountAppService( IAccountRepository accountRepository, IMapper mapper, ITransactionService transactionService, IDomainNotification notification) { _accountRepository = accountRepository; _mapper = mapper; _transactionService = transactionService; _notification = notification; }
public OrderProductController ( IDomainNotification domainNotification, IMapper mapper, IOrderService orderService, IOrderProductService orderProductService ) : base(domainNotification) { _mapper = mapper; _orderService = orderService; _orderProductService = orderProductService; }
private void PublishEvents(IAggregateRoot instance, IDomainNotification snapshotChange) { foreach (var evt in instance.UncommittedEvents.ToList()) { var modelChange = NotificationExtensions.CreateNotification(instance.GetType(), evt); this.changes.OnNext(modelChange); } if (snapshotChange != null) { this.changes.OnNext(snapshotChange); } }
private async Task PublishDomainNotificationAsync(IDomainNotification notification, CancellationToken token) { var publisher = _serviceProvider.GetService <IDomainNotificationPublisher>(); try { await publisher.PublishAsync(notification, token); } catch (Exception e) { _logger.LogError($"Publishing domain notification has a exception: {LogFormatter.PrintException(e)}."); } }
public static bool NeedReplyApplicationCommand(this IDomainNotification notification, out IEndSubTransactionDomainNotification needRepliedNotification) { if (notification.ApplicationCommandReplyScheme == ApplicationCommandReplySchemes.OnDomainCommandHandled && notification is IEndSubTransactionDomainNotification endNotification) { needRepliedNotification = endNotification; return(true); } needRepliedNotification = null; return(false); }
public async Task PublishAsync <TAggregateRootId>( IDomainNotification <TAggregateRootId> notification, CancellationToken token) { if (notification == null) { throw new ArgumentNullException(nameof(notification)); } notification.Topic = _options.Topic; await _messagePublisher.PublishAsync(notification, token); }
public void Publish(IDomainNotification evt) { this.eventPublisher.OnNext(evt); }
public void Publish(IDomainNotification evt) { this.PublishedEvents.Add(evt); }