public GIVEN_store_and_bus_with_an_aggregate_in_memory()
            {
                DbConfiguration.SetConfiguration(new TransientFaultHandlingDbConfiguration());

                this.serializer = CreateSerializer();
                this.dbName     = typeof(EventStoreFixture).Name;
                var connectionFactory = System.Data.Entity.Database.DefaultConnectionFactory;

                this.connectionString = connectionFactory.CreateConnection(this.dbName).ConnectionString;

                // *********************************
                // EN FECOPROD:

                this.connectionString = string.Format("server=(local);Database={0};User Id=sa;pwd =123456", this.dbName);

                // BORRAR CUANDO SEA NECESARIO
                //***********************************

                using (var context = new EventStoreDbContext(this.connectionString))
                {
                    if (context.Database.Exists())
                    {
                        context.Database.Delete();
                    }

                    context.Database.Create();
                }

                this.bus = new InMemoryBus();
                MessagingDbInitializer.CreateDatabaseObjects(this.connectionString, "Bus");
            }
예제 #2
0
        public EventStoreRebuilderEngine(
            IInMemoryBus bus,
            ICommandProcessor commandProcessor, ICommandHandlerRegistry commandHandlerRegistry, IEventDispatcher eventDispatcher,
            ITextSerializer serializer, IMetadataProvider metadataProvider,
            ITracer tracer,
            IEventStoreRebuilderConfig config,
            IRebuilderPerfCounter perfCounter)
        {
            this.bus                    = bus;
            this.serializer             = serializer;
            this.eventDispatcher        = eventDispatcher;
            this.commandProcessor       = commandProcessor;
            this.commandHandlerRegistry = commandHandlerRegistry;
            this.config                 = config;
            this.tracer                 = tracer;
            this.metadataProvider       = metadataProvider;
            this.perfCounter            = perfCounter;

            this.sourceContextFactory = () =>
            {
                var context = new EventStoreDbContext(this.config.SourceEventStoreConnectionString);
                context.Configuration.AutoDetectChangesEnabled = false;
                return(context);
            };
            this.newContextFactory = () => new EventStoreDbContext(this.config.NewEventStoreConnectionString);
        }
 public RaceEntriesController(IInMemoryBus bus,PersonQueryService personQuery,RaceQueryService raceQuery, PersonEventQueryService personEventQueryService)
 {
     Bus = bus;
     PersonQueryService = personQuery;
     RaceQueryService= raceQuery;
     RaceEntryQyerService = personEventQueryService;
 }
 public CreateUserHandler(ILogger <CreateUserHandler> logger, IEventStoreHydrator <Guid, UserEventStore> hydrator,
                          ICommandStrategyFactory <UserCommandContext> commandStrategyFactory, IInMemoryBus bus)
 {
     _strategy = commandStrategyFactory.Get <CreateUser>();
     _logger   = logger;
     _hydrator = hydrator;
     _bus      = bus;
 }
예제 #5
0
 protected DomainServiceBase(
     DomainServiceParameters domainServiceParameters
     )
 {
     UserSessionInfo   = domainServiceParameters.UserSessionInfo;
     GlobalizationInfo = domainServiceParameters.GlobalizationInfo;
     InMemoryBus       = domainServiceParameters.InMemoryBus;
 }
예제 #6
0
 public CustomerMustHaveUniqueCodeSpecification(
     IInMemoryBus inMemoryBus,
     IUserSessionInfo userSessionInfo,
     IGlobalizationInfo globalizarionInfo)
 {
     _inMemoryBus       = inMemoryBus;
     _userSessionInfo   = userSessionInfo;
     _globalizarionInfo = globalizarionInfo;
 }
예제 #7
0
 public PurchaseItemHandler(IInMemoryBus inMemoryBus,
                            ICommandStrategyFactory <StoreFrontContext> commandStrategyFactory,
                            ILogger <PurchaseItemHandler> logger, IInMemoryBus bus, IEventStoreHydrator <Guid, StoreFrontEventStore> hydrator)
 {
     _strategy = commandStrategyFactory.Get <PurchaseItem>();
     _logger   = logger;
     _bus      = bus;
     _hydrator = hydrator;
 }
예제 #8
0
 public HandlerBaseParameters(
     IInMemoryBus inMemoryBus,
     IUserSessionInfo userSessionInfo,
     IGlobalizationInfo globalizationInfo,
     DomainNotificationEventHandler domainNotificationEventHandler)
 {
     InMemoryBus       = inMemoryBus;
     UserSessionInfo   = userSessionInfo;
     GlobalizationInfo = globalizationInfo;
     DomainNotificationEventHandler = domainNotificationEventHandler;
 }
예제 #9
0
 public DomainServiceParameters(
     IUserSessionInfo userSessionInfo,
     IGlobalizationInfo globalizationInfo,
     IInMemoryBus inMemoryBus,
     DomainNotificationEventHandler domainNotificationEventHandler)
 {
     UserSessionInfo   = userSessionInfo;
     GlobalizationInfo = globalizationInfo;
     InMemoryBus       = inMemoryBus;
     DomainNotificationEventHandler = domainNotificationEventHandler;
 }
예제 #10
0
        public DomainNotificationEventHandler(
            IInMemoryBus inMemoryBus,
            IUserSessionInfo userSessionInfo,
            IGlobalizationInfo globalizationInfo
            )
        {
            InMemoryBus       = inMemoryBus;
            UserSessionInfo   = userSessionInfo;
            GlobalizationInfo = globalizationInfo;

            DomainNotificationEventCollection = new List <DomainNotificationEvent>();
        }
예제 #11
0
 public InMemoryEventStore(IInMemoryBus bus, ITextSerializer serializer, EventStoreDbContext context, ITracer tracer, ISystemTime dateTime, ISnapshotProvider snapshoter, IMetadataProvider metadataProvider)
     : base(tracer, serializer, dateTime, snapshoter, metadataProvider)
 {
     this.bus     = bus;
     this.context = context;
 }
예제 #12
0
 public ItemController(IInMemoryBus bus) => _bus = bus;
 public UserCreatedHandler(ILogger <UserCreatedHandler> logger, IInMemoryBus bus)
 {
     _logger = logger;
     _bus    = bus;
 }
예제 #14
0
 public TestController(IInMemoryBus localBus, TestQuery query)
 {
     this.localBus = localBus;
     this.query = query;
 }
예제 #15
0
 public UserController(IInMemoryBus bus) => _bus = bus;
예제 #16
0
 public RaceController(IInMemoryBus messageLocalBus,RaceQueryService raceQueryService)
 {
     this.raceQueryService = raceQueryService;
     this.localBus = messageLocalBus;
 }
예제 #17
0
 public PersonController(PersonQueryService personQuery, IInMemoryBus localBus)
 {
     LocalBus = localBus;
     this.personQuery = personQuery;
 }
예제 #18
0
 public ItemAddedHandler(ILogger <ItemAddedHandler> logger, IInMemoryBus bus)
 {
     _logger = logger;
     _bus    = bus;
 }