Пример #1
0
 public EventManager(IDomainEventDispatcher eventDispatcher, BaseDbContext dbContext, ILoggerFactory logger)
 {
     this.eventDispatcher = eventDispatcher;
     this.dbContext       = dbContext;
     Query       = dbContext.Set <EventEnvelope>();
     this.logger = logger.CreateLogger(nameof(EventManager));
 }
Пример #2
0
 public ProductsContext(
     DbContextOptions <ProductsContext> options,
     IDomainEventDispatcher dispatcher)
     : base(options)
 {
     _dispatcher = dispatcher;
 }
Пример #3
0
 public DomainEventsDispatcher(
     IDomainEventsAccessor domainEventsAccessor,
     IDomainEventDispatcher domainEventDispatcher)
 {
     _domainEventsAccessor  = domainEventsAccessor;
     _domainEventDispatcher = domainEventDispatcher;
 }
Пример #4
0
 private static Task DispatchAsync <TDomainEvent>(
     IDomainEventDispatcher dispatcher,
     TDomainEvent domainEvent)
     where TDomainEvent : IDomainEvent
 {
     return(dispatcher.DispatchEventAsync(domainEvent));
 }
Пример #5
0
 public BookContext(DbContextOptions options, DatabaseOption databaseOption, ILoggerFactory loggerFactory, IDomainEventDispatcher domainEventDispatcher) :
     base(options)
 {
     _databaseOption        = databaseOption;
     _loggerFactory         = loggerFactory;
     _domainEventDispatcher = domainEventDispatcher;
 }
Пример #6
0
 /// <summary>
 /// Dispatches each <see cref="IDomainEvent"/> that was added to any <see cref="IAggregateRoot"/> before <see cref="CommitAsync"/> was called.
 /// </summary>
 /// <param name="dispatcher">The <see cref="IDomainEventDispatcher"/>.</param>
 /// <param name="events">The <see cref="IEnumerable{T}"/> of <see cref="IDomainEvent"/>.</param>
 /// <returns></returns>
 protected virtual async Task DispatchEventsAsync(IDomainEventDispatcher dispatcher, IEnumerable <IDomainEvent> events)
 {
     foreach (var @event in events)
     {
         await dispatcher.RaiseAsync(@event);
     }
 }
Пример #7
0
        public RankingFamilyManager(IDomainEventDispatcher domainEventDispatcher, IScoreFamilyServiceManager scoreFamilyServiceManager)
        {
            this._domainEventDispatcher     = domainEventDispatcher;
            this._scoreFamilyServiceManager = scoreFamilyServiceManager;

            ALLOWED_STATUS_IDS = GetAllowedStatusId();
        }
Пример #8
0
 public AppDbContext(
     TenantInfo tenantInfo,
     DbContextOptions <AppDbContext> options,
     IDomainEventDispatcher dispatcher) : this(tenantInfo, options)
 {
     _dispatcher = dispatcher;
 }
Пример #9
0
 public AccountDomainRepository(
     IAccountDataRepository accountDataRepository,
     IDomainEventDispatcher domainEventDispatcher)
 {
     _accountDataRepository = accountDataRepository;
     _domainEventDispatcher = domainEventDispatcher;
 }
Пример #10
0
 public RealEstateContext(
     DbContextOptions <RealEstateContext> options,
     IDomainEventDispatcher domainEventDispatcher)
     : base(options)
 {
     _domainEventDispatcher = domainEventDispatcher;
 }
Пример #11
0
 public RejectSubmissionHandler(ISubmissionRepository submissionRepository, IDomainEventDispatcher domainEventDispatcher, IEventMapper eventMapper, IMessageBroker messageBroker)
 {
     _submissionRepository  = submissionRepository;
     _domainEventDispatcher = domainEventDispatcher;
     _eventMapper           = eventMapper;
     _messageBroker         = messageBroker;
 }
Пример #12
0
 public PostRepository(IHostingEnvironment environment, IMemoryCache memoryCache, IDomainEventDispatcher dispatcher)
 {
     this.environment = environment;
     this.memoryCache = memoryCache;
     this.dispatcher  = dispatcher;
     folder           = environment.ContentRootPath + "\\Data\\Posts\\";
 }
Пример #13
0
        private static ISessionFactory BuildSessionFactory(string connectionString, IDomainEventDispatcher domainEventDispatcher)
        {
            FluentConfiguration configuration = Fluently.Configure()
                                                .Database(MsSqlConfiguration.MsSql2012.ConnectionString(connectionString))
                                                .Mappings(m => m.FluentMappings
                                                          .AddFromAssembly(Assembly.GetExecutingAssembly())
                                                          .Conventions.Add(
                                                              ForeignKey.EndsWith("Id"),
                                                              ConventionBuilder.Property
                                                              .When(criteria => criteria.Expect(x => x.Nullable, Is.Not.Set), x => x.Not.Nullable()))
                                                          .Conventions.Add <TableNameConvention>()
                                                          .Conventions.Add <HiLoConvention>()
                                                          )
                                                .ExposeConfiguration(x =>
            {
                //to create db tables
                //new SchemaExport(x).Execute(true, true, false);
                x.EventListeners.PostCommitUpdateEventListeners =
                    new IPostUpdateEventListener[] { new NHibernateDbEventListener(domainEventDispatcher) };
                x.EventListeners.PostCommitInsertEventListeners =
                    new IPostInsertEventListener[] { new NHibernateDbEventListener(domainEventDispatcher) };
                x.EventListeners.PostCommitDeleteEventListeners =
                    new IPostDeleteEventListener[] { new NHibernateDbEventListener(domainEventDispatcher) };
                x.EventListeners.PostCollectionUpdateEventListeners =
                    new IPostCollectionUpdateEventListener[] { new NHibernateDbEventListener(domainEventDispatcher) };
            });

            return(configuration.BuildSessionFactory());
        }
Пример #14
0
 public ApplicationDbContext(DbContextOptions options,
                             IDomainEventDispatcher domainEventDispatcher,
                             IConfiguration configuration)
     : base(options)
 {
     _domainEventDispatcher = domainEventDispatcher;
     _useConsoleEfLogger    = Convert.ToBoolean(configuration[ConfigurationKeys.UseConsoleEfLogger]);
 }
Пример #15
0
 private EventStore(IDomainEventDispatcher domainEventDispatcher)
 {
     _eventStoreContext = new EventStoreDbContext(new DbContextOptionsBuilder <EventStoreDbContext>()
                                                  .UseInMemoryDatabase(databaseName: "EventStore")
                                                  .EnableSensitiveDataLogging()
                                                  .Options);
     _domainEventDispatcher = domainEventDispatcher;
 }
 public ReglasStonePaperScissorsSteps()
 {
     dispatcher = new DomainEventDispatcher();
     match      = new Match(dispatcher);
     player1    = new Player1(dispatcher);
     player2    = new Player2(dispatcher);
     outcome    = new Outcome(dispatcher);
 }
Пример #17
0
 public void DispatchAndClearAccumulatedEvents(IDomainEventDispatcher eventDispatcher)
 {
     foreach (var domainEvent in this._events)
     {
         eventDispatcher.Dispatch(domainEvent);
     }
     this._events.Clear();
 }
Пример #18
0
 public ApproveSubmissionHandler(ISubmissionRepository repository, IMessageBroker messageBroker,
                                 IEventMapper eventMapper, IDomainEventDispatcher dispatcher)
 {
     _repository    = repository;
     _messageBroker = messageBroker;
     _eventMapper   = eventMapper;
     _dispatcher    = dispatcher;
 }
Пример #19
0
 public HomeController(IWebHostEnvironment webHostEnvironment,
                       IDomainEventDispatcher dispatcher,
                       ILogger <HomeController> logger)
 {
     _webHostEnvironment = webHostEnvironment;
     _dispatcher         = dispatcher;
     _logger             = logger;
 }
Пример #20
0
 public ApplicationDbContext(
     DbContextOptions <ApplicationDbContext> options,
     IOptions <OperationalStoreOptions> operationalStoreOptions,
     IDomainEventDispatcher dispatcher
     ) : base(options, operationalStoreOptions)
 {
     _dispatcher = dispatcher;
 }
Пример #21
0
 public DailyCheckService(ILogger <DailyCheckService> logger,
                          IDomainEventDispatcher dispatcher,
                          IRepository <DailyCheck> repository)
 {
     _logger     = logger;
     _dispatcher = dispatcher;
     _repository = repository;
 }
Пример #22
0
 public GenerateResourcesCommandHandler(IDomainEventDispatcher eventDispatcher, ICommandDispatcher commandDispatcher, ITranslateResourceFactory translateResourceFactory, IGetLocaleById getLocaleById, IGetAllResourcesByApplicationIdAndLocaleId getAllResourcesByApplicationIdAndLocaleId)
 {
     _eventDispatcher          = eventDispatcher;
     _commandDispatcher        = commandDispatcher;
     _translateResourceFactory = translateResourceFactory;
     _getLocaleById            = getLocaleById;
     _getAllResourcesByApplicationIdAndLocaleId = getAllResourcesByApplicationIdAndLocaleId;
 }
 public CreateUserHandler(IMemberShipRepository memberShipRepository, IPasswordHasher passwordHasher,
                          IDomainEventDispatcher domainEventDispatcher, ILogger logger)
 {
     _memberShipRepository  = memberShipRepository;
     _passwordHasher        = passwordHasher;
     _domainEventDispatcher = domainEventDispatcher;
     _logger = logger;
 }
 public AspNetCoreIdentityUserRoleMembershipService(UserManager <ApplicationUser> userManager,
                                                    RoleManager <IdentityRole> roleManager,
                                                    IDomainEventDispatcher dispatcher)
 {
     _userManager = userManager;
     _roleManager = roleManager;
     _dispatcher  = dispatcher;
 }
Пример #25
0
 public MongoRepository(IBaseMongoRepositoryAdd repositoryAdd, IBaseMongoRepositoryUpdate repositoryUpdate,
                        IBaseMongoRepositoryDelete repositoryDelete, IDomainEventDispatcher domainEventDispatcher)
 {
     _repositoryAdd         = repositoryAdd;
     _repositoryUpdate      = repositoryUpdate;
     _repositoryDelete      = repositoryDelete;
     _domainEventDispatcher = domainEventDispatcher;
 }
Пример #26
0
        public DomainEventDispatcherEventStoreTransactionAnnouncer(IEventStore eventStore, IDomainEventDispatcher dispatcher)
            : base(eventStore)
        {
            Contract.Requires(dispatcher != null);
            Contract.Requires(eventStore != null);

            _dispatcher = dispatcher;
        }
 public ApprenticeshipIncentiveDomainRepository(
     IApprenticeshipIncentiveDataRepository apprenticeshipIncentiveDataRepository,
     IApprenticeshipIncentiveFactory apprenticeshipIncentiveFactory,
     IDomainEventDispatcher domainEventDispatcher)
 {
     _apprenticeshipIncentiveDataRepository = apprenticeshipIncentiveDataRepository;
     _apprenticeshipIncentiveFactory        = apprenticeshipIncentiveFactory;
     _domainEventDispatcher = domainEventDispatcher;
 }
 public SchemeUnpublishRequestHandler(
     IOptions <AggregatesConfig> cacheConfig,
     IMemoryCache memoryCache,
     IDomainEventDispatcher <PublicSchemeId> domainEventsDispatcher,
     IAggregateSnapshotAccessor <PublicScheme, PublicSchemeId> schemesSnapshot,
     IDomainEventStore <PublicSchemeId> eventsAccessor) :
     base(cacheConfig, memoryCache, domainEventsDispatcher, schemesSnapshot, eventsAccessor)
 {
 }
Пример #29
0
 public GameWeekHandler(IRepository repository, ITimerService timer, IDomainEventDispatcher dispatcher)
 {
     _repository = repository;
     _timer      = timer;
     _dispatcher = dispatcher;
     _season     = _repository.Get(new CurrentSeasonWithStandingsTeams());
     _games      = _repository.List(new GamesOnDate(_season.CurDate));
     _teams      = _repository.List(new TeamWithRecord());
 }
 public MailServiceDbContext(DbContextOptions <MailServiceDbContext> options, IClock clock,
                             ICurrentUserService currentUserService, IDomainEventDispatcher eventDispatcher,
                             ILogger <MailServiceDbContext> logger) : base(options)
 {
     _logger             = logger;
     _eventDispatcher    = eventDispatcher;
     _currentUserService = currentUserService;
     _clock = clock;
 }
Пример #31
0
 public PersonRepository(ISession session, IDomainEventDispatcher domainEventDispatcher)
 {
     _domainEventDispatcher = domainEventDispatcher;
     _personDao = new PersonDao(session.GetPort<System.Data.Common.DbConnection>());
 }
        /// <summary>
        /// Assign a new service resolver implementation.
        /// </summary>
        /// <param name="dispatcher">Resolver to use.</param>
        public static void Assign(IDomainEventDispatcher dispatcher)
        {
            if (dispatcher == null) throw new ArgumentNullException("dispatcher");

            _dispatcher = dispatcher;
        }
Пример #33
0
 public DbContext(IDomainEventDispatcher domainEventDispatcher)
 {
     _domainEventDispatcher = domainEventDispatcher;
 }
Пример #34
0
 public DapperEventStore(ISerializer serializer, IDomainEventDispatcher dispatcher, DapperEventStoreSettings settings)
 {
     _serializer = serializer;
     _dispatcher = dispatcher;
     _settings   = settings;
 }