Example #1
0
 public SnapshotReaderCosmosDB(
     ICosmosDBClient cosmosDbClient,
     ICosmosDBConfigurations cosmosDBConfigurations,
     IEventDeserializer deserializer)
 {
     _cosmosDbClient         = cosmosDbClient ?? throw new ArgumentNullException(nameof(cosmosDbClient));
     _cosmosDBConfigurations = cosmosDBConfigurations ?? throw new ArgumentNullException(nameof(cosmosDBConfigurations));
     _deserializer           = deserializer ?? throw new ArgumentNullException(nameof(deserializer));
 }
Example #2
0
 public AppendToStreamAsyncHandler(IEventSerializer eventSerializer,
                                   ICosmosDBClient cosmosClient,
                                   ICosmosDBConfigurations cosmosDBConfigurations,
                                   IOperationDispatcher operationDispatcher)
 {
     _eventSerializer        = eventSerializer ?? throw new ArgumentNullException(nameof(eventSerializer));
     _cosmosClient           = cosmosClient ?? throw new ArgumentNullException(nameof(cosmosClient));
     _cosmosDBConfigurations = cosmosDBConfigurations ?? throw new ArgumentNullException(nameof(cosmosDBConfigurations));
     _operationDispatcher    = operationDispatcher ?? throw new ArgumentNullException(nameof(operationDispatcher));
 }
Example #3
0
        public CosmosDBConnection(IEventSerializer eventSerializer,
                                  ICosmosDBClient cosmosClient,
                                  ICosmosDBConfigurations cosmosDBConfigurations,
                                  IOperationDispatcher operationDispatcher)
        {
            _eventSerializer        = eventSerializer ?? throw new ArgumentNullException(nameof(eventSerializer));
            _cosmosClient           = cosmosClient ?? throw new ArgumentNullException(nameof(cosmosClient));
            _cosmosDBConfigurations = cosmosDBConfigurations ?? throw new ArgumentNullException(nameof(cosmosDBConfigurations));
            _operationDispatcher    = operationDispatcher ?? throw new ArgumentNullException(nameof(operationDispatcher));

            RegisterHandlers();
        }
Example #4
0
 public SnapshotterCosmosDB(IAggregateRootRepository <TAggregateRoot> rootRepository,
                            IAggregateChangeTracker changeTracker,
                            ICosmosDBClient cosmosDbClient,
                            ICosmosDBConfigurations cosmosDBConfigurations,
                            IEventSerializer eventSerializer)
 {
     _rootRepository         = rootRepository ?? throw new ArgumentNullException(nameof(rootRepository));
     _changeTracker          = changeTracker ?? throw new ArgumentNullException(nameof(changeTracker));
     _cosmosDbClient         = cosmosDbClient ?? throw new ArgumentNullException(nameof(cosmosDbClient));
     _cosmosDBConfigurations = cosmosDBConfigurations ?? throw new ArgumentNullException(nameof(cosmosDBConfigurations));
     _eventSerializer        = eventSerializer ?? throw new ArgumentNullException(nameof(eventSerializer));
 }
Example #5
0
 public AggregateStoreDependencies(IEventSerializer eventSerializer,
                                   IEventDeserializer eventDeserializer,
                                   ICosmosDBConnection cosmosDBConnection,
                                   ICosmosDBConfigurations cosmosDBConfigurations,
                                   IStreamNameProvider streamNameProvider)
 {
     EventSerializer        = eventSerializer;
     EventDeserializer      = eventDeserializer;
     CosmosDBConnection     = cosmosDBConnection;
     CosmosDBConfigurations = cosmosDBConfigurations;
     StreamNameProvider     = streamNameProvider;
 }
 internal GetStreamDocumentByIdAsyncHandler(ICosmosDBClient cosmosClient,
                                            ICosmosDBConfigurations cosmosDBConfigurations)
 {
     _cosmosClient           = cosmosClient;
     _cosmosDBConfigurations = cosmosDBConfigurations;
 }
Example #7
0
 private static IServiceCollection RegisterSnapshotableRepositories(this IServiceCollection services, ICosmosDBConfigurations configurations) =>
 configurations.IsSnapshottingOn ? services.AddScoped(typeof(IAggregateRootRepository <>), typeof(SnapshotableRootRepository <>))
                                     : services;
Example #8
0
 public GetEventDocumentsForwardHandler(ICosmosDBClient cosmosClient,
                                        ICosmosDBConfigurations cosmosDBConfigurations)
 {
     _cosmosClient           = cosmosClient;
     _cosmosDBConfigurations = cosmosDBConfigurations;
 }
Example #9
0
 public CosmosDBClient(CosmosClient client,
                       ICosmosDBConfigurations cosmosDBConfigurations)
 {
     _client = client ?? throw new ArgumentNullException(nameof(client));
     _cosmosDBConfigurations = cosmosDBConfigurations ?? throw new ArgumentNullException(nameof(cosmosDBConfigurations));
 }