Papst.EventStore.AzureCosmos 5.2.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Papst.EventStore.AzureCosmos --version 5.2.10
                    
NuGet\Install-Package Papst.EventStore.AzureCosmos -Version 5.2.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Papst.EventStore.AzureCosmos" Version="5.2.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Papst.EventStore.AzureCosmos" Version="5.2.10" />
                    
Directory.Packages.props
<PackageReference Include="Papst.EventStore.AzureCosmos" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Papst.EventStore.AzureCosmos --version 5.2.10
                    
#r "nuget: Papst.EventStore.AzureCosmos, 5.2.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Papst.EventStore.AzureCosmos@5.2.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Papst.EventStore.AzureCosmos&version=5.2.10
                    
Install as a Cake Addin
#tool nuget:?package=Papst.EventStore.AzureCosmos&version=5.2.10
                    
Install as a Cake Tool

Azure Cosmos Implementation of Event Stream

The Azure Cosmos Implementation needs to be added to the dependency injection container.

To achieve this, there are two extension methods available, one using a client factory function and one a direct CosmosClient parameter:

IServiceCollection services;

// direct CosmosClient parameter
services.AddCosmosEventStore(
    new CosmosClient(...),
    "database",
    "container");

// CosmosClient Factory, that has a IServiceProvider as parameter
services.AddCosmosEventStore(
    sp => sp.GetRequiredService<CosmosClient>(),
    "database",
    "container");

In addition it is necessary to Configure the class CosmosEventStoreOptions with the options below.

Configuration

The CosmosEventStore class uses the Options pattern to retrieve its configuration. Therefore, the Configuration must be added to the Dependency Injection by using services.Configure<CosmosEventStoreOptions>(). The C# representation of the Configuration Sections looks like this:

public class CosmosEventStoreOptions
{
  /// <summary>
  /// Count of retries when two parties are updating the same stream to avoid concurrency issues
  /// </summary>
  public int ConcurrencyRetryCount { get; set; } = 3;
  
  /// <summary>
  /// Whether to try to build the index for an existing stream, when no index is found
  /// or to return a <see cref="Papst.EventStore.Exceptions.EventStreamNotFoundException"/>
  /// </summary>
  public bool BuildIndexOnNotFound { get; set; }
  
  /// <summary>
  /// Flag if the Tenant Id of the Stream Meta Data should be updated when appending a new event
  /// </summary>
  public bool UpdateTenantIdOnAppend { get; set; } = true;
}

Migration

With the new V5 based implementation, there is need for an index document in the cosmos database for each stream.

For a convenient upgrade, there has been an option to the configuration added, that builds an index, when a stream is requested using GetAsync method in IEventStore and the stream is not found.

A manual upgrade is not yet supported.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.2.32 149 6/3/2025
5.2.30 204 2/12/2025
5.2.28 129 2/9/2025
5.2.25 113 2/9/2025
5.2.23 119 2/9/2025
5.2.21 126 12/7/2024
5.2.18 757 11/12/2024
5.2.14 145 11/10/2024
5.2.12 119 11/10/2024
5.2.10 117 11/10/2024
5.2.7 291 9/28/2024
5.1.4 217 8/26/2024
5.1.2 139 8/22/2024
5.0.12 137 8/15/2024
5.0.10 115 8/7/2024
5.0.9 109 8/7/2024
5.0.8 118 8/7/2024
5.0.6 114 8/6/2024
5.0.4 101 8/6/2024
5.0.2 105 8/4/2024