Soenneker.Cosmos.Repositories.General 11.0.779

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Cosmos.Repositories.General --version 11.0.779
                    
NuGet\Install-Package Soenneker.Cosmos.Repositories.General -Version 11.0.779
                    
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="Soenneker.Cosmos.Repositories.General" Version="11.0.779" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Cosmos.Repositories.General" Version="11.0.779" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Cosmos.Repositories.General" />
                    
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 Soenneker.Cosmos.Repositories.General --version 11.0.779
                    
#r "nuget: Soenneker.Cosmos.Repositories.General, 11.0.779"
                    
#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 Soenneker.Cosmos.Repositories.General@11.0.779
                    
#: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=Soenneker.Cosmos.Repositories.General&version=11.0.779
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Cosmos.Repositories.General&version=11.0.779
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Cosmos.Repositories.General

An abstract Cosmos repository base for multiple typed-document models stored in the shared general container.

Installation

dotnet add package Soenneker.Cosmos.Repositories.General

Define a repository

The package does not register a concrete service. Derive from GeneralRepository<TDocument>, where the document extends TypedDocument, and provide the discriminator stored in its EntityType property.

public interface IWidgetRepository : IGeneralRepository<WidgetDocument>
{
}

public sealed class WidgetRepository : GeneralRepository<WidgetDocument>, IWidgetRepository
{
    protected override string EntityType => "widget";

    public WidgetRepository(
        ICosmosContainerUtil containerUtil,
        IConfiguration configuration,
        ILogger<GeneralRepository<WidgetDocument>> logger,
        IUserContext userContext,
        IBackgroundQueue backgroundQueue,
        IMemoryStreamUtil memoryStreamUtil)
        : base(containerUtil, configuration, logger, userContext, backgroundQueue, memoryStreamUtil)
    {
    }
}

Register your implementation as scoped because the repository consumes scoped user context:

services.AddScoped<IWidgetRepository, WidgetRepository>();

The Cosmos container, user context, background queue, memory-stream utility, configuration, and logging dependencies must also be registered. This package deliberately does not choose their lifetimes for the application.

Behavior

All derived repositories use the general container. GetAll, GetAllIds, DeleteAll, DeleteAllPaged, and DeleteAllPagedParallel limit their work to documents whose EntityType equals the derived repository's discriminator. The rest of the inherited ICosmosRepository<TDocument> API provides point reads, queries, writes, conditional ETag operations, paging, and audit support.

Documents must use the partition-key shape expected by Soenneker.Cosmos.Repository and the configured container. Choose stable, unique EntityType values; two repository types using the same value operate on the same documents.

Delete-all operations are permanent and are not transactional across the full result set. Failures and cancellation propagate after any already completed deletes.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Cosmos.Repositories.General:

Package Downloads
Soenneker.Librarian.Cosmos

Librarian native document storage backed by Cosmos with server queries and atomic batches.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.795 36 10/28/2026
11.0.794 63 10/27/2026
11.0.793 51 10/27/2026
11.0.792 43 10/27/2026
11.0.791 38 10/27/2026
11.0.790 41 10/27/2026
11.0.789 47 10/27/2026
11.0.788 44 10/27/2026
11.0.787 42 10/27/2026
11.0.786 38 10/27/2026
11.0.785 39 10/27/2026
11.0.784 56 10/26/2026
11.0.783 61 10/26/2026
11.0.781 51 10/26/2026
11.0.780 53 10/26/2026
11.0.779 53 10/26/2026
4.0.778 280 10/15/2026
4.0.777 173 10/15/2026
4.0.776 109 10/15/2026
4.0.775 88 10/15/2026
Loading failed

Merge remote-tracking branch 'origin/main'

# Conflicts:
# test/Soenneker.Cosmos.Repositories.General.Tests/Soenneker.Cosmos.Repositories.General.Tests.csproj