Soenneker.Managers.Entities 11.0.1602

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

An abstract CRUD manager that maps application entities to Cosmos DB documents.

Install

dotnet add package Soenneker.Managers.Entities

Usage

public interface IOrdersManager : IEntitiesManager<Order>
{
}

public sealed class OrdersManager : EntitiesManager<Order, OrderDocument>, IOrdersManager
{
    public OrdersManager(
        ICosmosRepository<OrderDocument> repository,
        IRedisUtil redis,
        ILogger<EntitiesManager<Order, OrderDocument>> logger,
        IUserContext userContext)
        : base(repository, redis, logger, userContext)
    {
    }
}

The entity and document types must expose compatible properties for AdaptViaReflection. Register the derived manager—normally scoped—and ensure the matching ICosmosRepository<TDocument> is registered.

Order created = await orders.Create(new Order { Name = "Sample" }, cancellationToken);
Order loaded = await orders.Get(created.Id, cancellationToken);
loaded.Name = "Updated";
await orders.Update(loaded, cancellationToken);
await orders.Delete(loaded.Id, cancellationToken);

What you get

  • IEntitiesManager<TEntity> — An abstract generic manager class provides CRUD operations for entities mapped to Cosmos DB documents.

API at a glance

API What it does Result / important behavior
IEntitiesManager<TEntity>.Create(entity, cancellationToken) Creates a new entity and stores it in the underlying data store. The created entity, with updated values such as generated ID.
IEntitiesManager<TEntity>.Get(id, cancellationToken) Retrieves a single entity by its identifier. The entity corresponding to the given ID.
IEntitiesManager<TEntity>.GetAll<TResponse>(options, cancellationToken) Retrieves documents and maps them to entities. A PagedResult<TEntity>; the base implementation only uses PageSize.
IEntitiesManager<TEntity>.Update(entity, cancellationToken) Updates an existing entity in the data store. The updated entity.
IEntitiesManager<TEntity>.Delete(id, cancellationToken) Deletes an entity from the data store by ID. A task representing the asynchronous operation.

Important behavior

  • IEntitiesManager<TEntity>.Get(id, cancellationToken): Thrown if the entity is not found.
  • IEntitiesManager<TEntity>.Update(entity, cancellationToken): Thrown if the entity to update is not found.
  • IEntitiesManager<TEntity>.Delete(id, cancellationToken): Thrown if the entity to delete is not found.

Practical notes

  • Create() assigns a new GUID as both document id and partition key, sets CreatedAt, and replaces the entity's Id with the repository result.
  • Update() sets ModifiedAt. Get(), Update(), and Delete() throw EntityNotFoundException when the id is absent.
  • The base GetAll<TResponse>() does not apply continuation tokens, ordering, search, filters, counts, or TResponse; override it when those semantics are required.
  • Caller cancellation is passed through to every Cosmos operation.
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

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
11.0.1608 0 11/30/2026
11.0.1607 0 11/30/2026
11.0.1606 0 11/30/2026
11.0.1605 0 11/30/2026
11.0.1604 0 11/30/2026
11.0.1603 0 11/29/2026
11.0.1602 0 11/29/2026
11.0.1601 0 11/29/2026
11.0.1599 0 11/29/2026
11.0.1598 0 11/29/2026
11.0.1597 0 11/29/2026
11.0.1596 150 11/22/2026
11.0.1595 159 11/19/2026
11.0.1594 96 11/19/2026
11.0.1593 94 11/19/2026
11.0.1592 98 11/19/2026
11.0.1591 94 11/19/2026
11.0.1590 95 11/18/2026
11.0.1588 91 11/18/2026
11.0.1586 96 11/18/2026
Loading failed

Updated Multiple NuGet packages