-
Install NuGet package JKang.EventSourcing.Persistence.CosmosDB
PM> Install-Package JKang.EventSourcing.Persistence.CosmosDB
-
Register event sourcing services in ConfigureServices()
services .AddSingleton(_ => new CosmosClientBuilder(Configuration.GetConnectionString("CosmosDB")) .WithConnectionModeDirect() .WithCustomSerializer(new EventSourcingCosmosSerializer()) .Build()) .AddEventSourcing(builder => { builder.UseCosmosDBEventStore<GiftCard, Guid>(x => { x.DatabaseId = "EventSourcingTestingWebApp"; x.ContainerId = "GiftcardEvents"; }); });