public UploadDocumentCommandHandler(ILogger <UploadDocumentCommandHandler> logger, IAggregateRepository <SIOStoreDbContext> aggregateRepository, IAggregateFactory aggregateFactory, IFileClient fileClient) { if (logger == null) { throw new ArgumentNullException(nameof(logger)); } if (aggregateRepository == null) { throw new ArgumentNullException(nameof(aggregateRepository)); } if (aggregateFactory == null) { throw new ArgumentNullException(nameof(aggregateFactory)); } if (fileClient == null) { throw new ArgumentNullException(nameof(fileClient)); } _logger = logger; _aggregateRepository = aggregateRepository; _aggregateFactory = aggregateFactory; _fileClient = fileClient; }
public AddressController(IRepository <Address, Guid> addressRepository, IAddressDataProvider addressDataProvider, IAggregateFactory <Address, AddressFactoryInput, Guid> addressFactory, IMeterReadDataProvider meterReadDataProvider) { _addressRepository = addressRepository; _addressDataProvider = addressDataProvider; _addressFactory = addressFactory; _meterReadDataProvider = meterReadDataProvider; }
public AkkaNinjectDependencyResolver(IKernel kernel, ActorSystem system) : base(kernel) { RawAkkaNinjectDependencyResolver = new global::Akka.DI.Ninject.NinjectDependencyResolver(kernel, AkkaSystem = system); AkkaActors = new ConcurrentDictionary <Type, IActorRef>(); AggregateFactory = Resolve <IAggregateFactory>(); }
public ProductRepository(IAggregateFactory aggregateFactory) { _client = new ElasticClient(); _factory = aggregateFactory; Mapper.CreateMap <Product, ProductDTO>(); }
public StatelessLocalCommandHandler(IAggregateFactory factory, IEventStore eventStore, ISnapshotStore snapshotStore) { _factory = factory; _snapshotStore = snapshotStore; _eventStore = eventStore; }
public LiteDbAggregateRepository( IAggregateFactory factory, IEventPublisher publishEndpoint, ILiteDatabase liteDb) : base(factory, publishEndpoint) { LiteDb = liteDb ?? throw new System.ArgumentNullException(nameof(liteDb)); }
public ProductRepository(IAggregateFactory aggregateFactory) { _client = new ElasticClient(); _factory = aggregateFactory; Mapper.CreateMap<Product, ProductDTO>(); }
public Repository(IAggregateFactory factory, IEventStore eventStore) { _factory = factory ?? throw new ArgumentNullException(nameof(factory)); _eventStore = eventStore ?? throw new ArgumentNullException(nameof(eventStore)); MementoStore = NullMementoStore.Instance; }
public LoginCommandHandler(UserManager <SIOUser> userManager, SignInManager <SIOUser> signInManager, IAggregateRepository <SIOStoreDbContext> aggregateRepository, IAggregateFactory aggregateFactory, ILogger <LoginCommandHandler> logger) { if (userManager == null) { throw new ArgumentNullException(nameof(userManager)); } if (signInManager == null) { throw new ArgumentNullException(nameof(signInManager)); } if (aggregateRepository == null) { throw new ArgumentNullException(nameof(aggregateRepository)); } if (aggregateFactory == null) { throw new ArgumentNullException(nameof(aggregateFactory)); } if (logger == null) { throw new ArgumentNullException(nameof(logger)); } _userManager = userManager; _signInManager = signInManager; _aggregateRepository = aggregateRepository; _aggregateFactory = aggregateFactory; _logger = logger; }
public AggregateDependencies(IAggregateFactory <TAggregate> factory = null) { if (factory != null) { AggregateFactory = factory; } }
protected SqlServerAggregateRepository(EventStoreContext dbContext, IDocumentSerializer serializer, IAggregateFactory aggregateFactory) { _dbContext = dbContext; _aggregateFactory = aggregateFactory; _serializer = serializer; }
public Repository(IAggregateFactory aggregateFactory, IEventStore <TAuthenticationToken> eventStore, IEventPublisher <TAuthenticationToken> publisher, ICorrelationIdHelper correlationIdHelper) { EventStore = eventStore; Publisher = publisher; CorrelationIdHelper = correlationIdHelper; AggregateFactory = aggregateFactory; }
protected internal Repository(Builder builder) { storage_ = builder.EventStorage; serialzer_ = builder.EventSerializer; aggregate_factory_ = builder.AggregateFactory; conflict_evaluator_ = builder.ConflictEvaluator; }
public RentController(IRepository <Rent, Guid> rentRepository, IAggregateFactory <Rent, RentFactoryInput, Guid> rentAggregateFactory, RentAssignDomainService rentAssignDomainService) { _rentRepository = rentRepository; _rentAggregateFactory = rentAggregateFactory; _rentAssignDomainService = rentAssignDomainService; }
public EventStoreRepository(IAggregateFactory factory, IEventStoreConnection connection, IOptionsMonitor <EventStoreSettings> settings) { _factory = factory; _connection = connection; _settings = settings.CurrentValue; }
public FilesEventStore( ILog log, IAggregateFactory aggregateFactory, IEventJsonSerializer eventJsonSerializer, IEnumerable <IMetadataProvider> metadataProviders, IEventUpgradeManager eventUpgradeManager, IJsonSerializer jsonSerializer, IFilesEventStoreConfiguration configuration) : base(log, aggregateFactory, eventJsonSerializer, eventUpgradeManager, metadataProviders) { _jsonSerializer = jsonSerializer; _configuration = configuration; _logFilePath = Path.Combine(_configuration.StorePath, "Log.store"); if (File.Exists(_logFilePath)) { var json = File.ReadAllText(_logFilePath); var eventStoreLog = _jsonSerializer.Deserialize <EventStoreLog>(json); _globalSequenceNumber = eventStoreLog.GlobalSequenceNumber; _log = eventStoreLog.Log ?? new Dictionary <long, string>(); if (_log.Count != _globalSequenceNumber) { eventStoreLog = RecreateEventStoreLog(_configuration.StorePath); _globalSequenceNumber = eventStoreLog.GlobalSequenceNumber; _log = eventStoreLog.Log; } } else { _log = new Dictionary <long, string>(); } }
public InMemoryEventStore( ILog log, IAggregateFactory aggregateFactory, IEventJsonSerializer eventJsonSerializer, IEnumerable <IMetadataProvider> metadataProviders) : base(log, aggregateFactory, eventJsonSerializer, metadataProviders) { }
public AggregateSnapshotRespositoryDecorator(IAggregateRepository decorated, IAggregateFactory aggregateFactory, IEventStore eventStore, ISnapshotStore snapshotStore, ISnapshotStrategy snapshotStrategy) { _decoratedRepository = decorated ?? throw new ArgumentNullException(nameof(decorated)); _aggregateFactory = aggregateFactory ?? throw new ArgumentNullException(nameof(aggregateFactory)); _eventStore = eventStore ?? throw new ArgumentNullException(nameof(eventStore)); _snapshotStore = snapshotStore ?? throw new ArgumentNullException(nameof(snapshotStore)); _snapshotStrategy = snapshotStrategy ?? throw new ArgumentNullException(nameof(snapshotStrategy)); }
public SnapshotRepository(ISnapshotStore snapshotStore, ISnapshotStrategy <TAuthenticationToken> snapshotStrategy, IRepository <TAuthenticationToken> repository, IEventStore <TAuthenticationToken> eventStore, IAggregateFactory aggregateFactory) { SnapshotStore = snapshotStore; SnapshotStrategy = snapshotStrategy; Repository = repository; EventStore = eventStore; AggregateFactory = aggregateFactory; }
/// <summary> /// Initializes a new instance of the <see cref="StateStrategy<TEntity, TId>"/> class. /// </summary> /// <param name="factory">The factory.</param> /// <param name="refuseEngine">The refuse engine.</param> /// <param name="maxEvents">The max events.</param> protected StateStrategy(IAggregateFactory <TEntity, TId> factory, IRefuseEngine <TEntity, TId> refuseEngine, int maxEvents) { _refuseEngine = refuseEngine; _maxEvents = maxEvents; _factory = factory; _strategies = new Dictionary <string, Action <AggregateRoot <TEntity, TId> > >(); ConfigureStrategy(); }
/// <summary> /// Instantiates a new instance of <see cref="SagaRepository{TAuthenticationToken}"/> /// </summary> public SagaRepository(IAggregateFactory sagaFactory, IEventStore <TAuthenticationToken> eventStore, IEventPublisher <TAuthenticationToken> publisher, ICommandPublisher <TAuthenticationToken> commandPublisher, ICorrelationIdHelper correlationIdHelper) { EventStore = eventStore; Publisher = publisher; CorrelationIdHelper = correlationIdHelper; CommandPublisher = commandPublisher; SagaFactory = sagaFactory; }
public CommandDispatcher(IServiceLocator serviceLocator, IEventRepo eventRepo, IAggregateFactory <A> aggreageFactory, ILogger log) { _eventRepo = eventRepo; _serviceLocator = serviceLocator; _aggreageFactory = aggreageFactory; _log = log; }
/// <summary> /// Instantiates a new instance of <see cref="AkkaNinjectDependencyResolver"/> /// </summary> public AkkaNinjectDependencyResolver(IKernel kernel, ActorSystem system) : base(kernel) { RawAkkaNinjectDependencyResolver = new global::Akka.DI.Ninject.NinjectDependencyResolver(kernel, AkkaSystem = system); AkkaActors = new ConcurrentDictionary <Type, IActorRef>(); // ReSharper disable DoNotCallOverridableMethodsInConstructor AggregateFactory = Resolve <IAggregateFactory>(); // ReSharper restore DoNotCallOverridableMethodsInConstructor }
public Repository( IAggregateFactory aggregateFactory, IEventStore eventStore, IEventPublisher eventPublisher) { _eventStore = eventStore; _aggregateFactory = aggregateFactory; _eventPublisher = eventPublisher; }
public AggregateRepository( IEventRepository eventRepository, IAggregateFactory aggregateFactory, ISnapshotEventRepository snapshotEventRepository = null) { _eventRepository = eventRepository ?? throw new ArgumentNullException(nameof(eventRepository)); _aggregateFactory = aggregateFactory ?? throw new ArgumentNullException(nameof(aggregateFactory)); _snapshotEventRepository = snapshotEventRepository; }
public void WhenConstructedWithNullQuerySerializerShouldThrowArgumentNullException() { var eventStore = new Mock <IEventStore>().Object; IAggregateFactory aggregateFactory = null; Action act = () => new EntityFrameworkCore.AggregateRepository(eventStore, aggregateFactory); act.Should().Throw <ArgumentNullException>(). And.ParamName.Should().Be("aggregateFactory"); }
public MsSqlEventStore( ILog log, IAggregateFactory aggregateFactory, IEventJsonSerializer eventJsonSerializer, IEnumerable <IMetadataProvider> metadataProviders, IMsSqlConnection connection) : base(log, aggregateFactory, eventJsonSerializer, metadataProviders) { _connection = connection; }
public AggregateStore(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; _logger = serviceProvider.GetRequiredService <ILogger <AggregateStore> >(); _eventJsonSerializer = serviceProvider.GetRequiredService <IEventJsonSerializer>(); _persistenceFactory = serviceProvider.GetRequiredService <IPersistenceFactory>(); _aggregateFactory = serviceProvider.GetRequiredService <IAggregateFactory>(); _transientFaultHandler = serviceProvider.GetRequiredService <ITransientFaultHandler <IOptimisticConcurrencyResilientStrategy> >(); _cancellationConfiguration = serviceProvider.GetRequiredService <ICancellationConfiguration>(); }
public EvolutionService(IEvolutionRepository mensagemRepository, IAggregateFactory aggregateFactory, IValidatorFactory validationFactory, IEvolutionDapperRepository evolutionDapperRepository) { _mensagemRepository = mensagemRepository; _aggregateFactory = aggregateFactory; _validationFactory = validationFactory; _evolutionDapperRepository = evolutionDapperRepository; }
public AggregateStore( IAggregateFactory aggregateFactory, IEventStore eventStore, ISnapshotStore snapshotStore, ITransientFaultHandler <IOptimisticConcurrencyRetryStrategy> transientFaultHandler) { _aggregateFactory = aggregateFactory; _eventStore = eventStore; _snapshotStore = snapshotStore; _transientFaultHandler = transientFaultHandler; }
/// <summary> /// Initializes a new instance of the <see cref="EventStoreRepository" /> class. /// </summary> /// <param name="eventStoreFactory">The event store factory.</param> /// <param name="factory">The factory.</param> /// <param name="conflictDetector">The conflict detector.</param> /// <param name="unitOfWorkProvider">The unit of work provider.</param> public EventStoreRepository( IEventStoreFactory eventStoreFactory, IAggregateFactory factory, IDetectConflicts conflictDetector, IUnitOfWorkProvider unitOfWorkProvider) { _eventStoreFactory = eventStoreFactory; _factory = factory; _conflictDetector = conflictDetector; _unitOfWorkProvider = unitOfWorkProvider; }
public void Setup() { _repository = new Repository<EntityEventSource<Ship, ObjectId>, ObjectId>("RationalEvs", "EventSourcing"); _queryBuilder = new MongoQuerySnapshotBuilder<Ship, ObjectId>(); _eventsRepository = new EventsRepository<Ship, ObjectId>(_repository, _queryBuilder, 0); _fsmConfigurator = FsmConfiguratorFactory.WithXgml("shipStateMachine.xgml").SetInitialState("In Navigation").WithDomainAssembly <DepartureEvent>("RationalEvs.Test.DomainFake.Events"). Create(); _aggregateFactory = new AggregateRootFactory<Ship, ObjectId>(_eventsRepository, _fsmConfigurator) { Logger = LogManager.GetLogger(GetType()) }; _ship = new Ship { Id = ObjectId.GenerateNewId() }; }