public CosmosDbEventStoreTests() { _snapshotProviderMock = new Mock <ISnapshotBehaviorProvider>(); EventStoreAzureDbContext.Activate(new AzureDbConfiguration("https://localhost:8081", "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==")) .GetAwaiter().GetResult(); _cosmosDbEventStore = GetCosmosDbEventStore(); }
public async Task GetEventsByAggregateId() { var store = new CosmosDbEventStore(); var evt = await store.GetEventsFromAggregateIdAsync <BenchmarkSimpleEvent> ( AggregateId ); }
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))); }
public async Task StoreDomainEvent() { var store = new CosmosDbEventStore(); await store.StoreDomainEventAsync( new TestEvent(Guid.NewGuid(), AggregateId) { AggregateIntValue = 1, AggregateStringValue = "test" }); }