コード例 #1
0
 public CosmosDbEventStoreTests()
 {
     _snapshotProviderMock = new Mock <ISnapshotBehaviorProvider>();
     EventStoreAzureDbContext.Activate(new AzureDbConfiguration("https://localhost:8081",
                                                                "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="))
     .GetAwaiter().GetResult();
     _cosmosDbEventStore = GetCosmosDbEventStore();
 }
コード例 #2
0
 public async Task GetEventsByAggregateId()
 {
     var store = new CosmosDbEventStore();
     var evt   = await store.GetEventsFromAggregateIdAsync <BenchmarkSimpleEvent>
                 (
         AggregateId
                 );
 }
コード例 #3
0
        public ISession GetSession()
        {
            var documentClient     = DocumentClientFactory.GetDocumentClientInstance(descriptor.CosmosDbConnectionString, options);
            var cosmosDbEventStore = new CosmosDbEventStore(documentClient, descriptor.DatabaseName, descriptor.CollectionName);

            var eventGridClientContext = EventGridClientFactory.GetEventGridClientContext(descriptor.EventGridConnectionString);
            var eventGridPublisher     = new EventGridEventPublisher(eventGridClientContext.EventGridClient, eventGridClientContext.TopicHostName);

            return(new Session(new Repository(cosmosDbEventStore, eventGridPublisher)));
        }
コード例 #4
0
 public async Task StoreDomainEvent()
 {
     var store = new CosmosDbEventStore();
     await store.StoreDomainEventAsync(
         new TestEvent(Guid.NewGuid(), AggregateId)
     {
         AggregateIntValue    = 1,
         AggregateStringValue = "test"
     });
 }