Soenneker.Managers.Entities
4.0.1332
Prefix Reserved
dotnet add package Soenneker.Managers.Entities --version 4.0.1332
NuGet\Install-Package Soenneker.Managers.Entities -Version 4.0.1332
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="4.0.1332" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Managers.Entities" Version="4.0.1332" />
<PackageReference Include="Soenneker.Managers.Entities" />
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 4.0.1332
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Soenneker.Managers.Entities, 4.0.1332"
#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@4.0.1332
#: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=4.0.1332
#tool nuget:?package=Soenneker.Managers.Entities&version=4.0.1332
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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, setsCreatedAt, and replaces the entity'sIdwith the repository result.Update()setsModifiedAt.Get(),Update(), andDelete()throwEntityNotFoundExceptionwhen the id is absent.- The base
GetAll<TResponse>()does not apply continuation tokens, ordering, search, filters, counts, orTResponse; override it when those semantics are required. - Caller cancellation is passed through to every Cosmos operation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- Soenneker.Cosmos.Repository (>= 4.0.8217)
- Soenneker.Dtos.RequestDataOptions (>= 4.0.198)
- Soenneker.Dtos.Results.Paged (>= 4.0.45)
- Soenneker.Managers.Base (>= 4.0.633)
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 |
|---|---|---|
| 4.0.1332 | 0 | 9/4/2026 |
| 4.0.1331 | 0 | 9/4/2026 |
| 4.0.1330 | 16 | 9/4/2026 |
| 4.0.1329 | 36 | 9/4/2026 |
| 4.0.1327 | 28 | 9/4/2026 |
| 4.0.1326 | 36 | 9/4/2026 |
| 4.0.1325 | 39 | 9/4/2026 |
| 4.0.1323 | 36 | 9/3/2026 |
| 4.0.1322 | 49 | 9/3/2026 |
| 4.0.1321 | 46 | 9/3/2026 |
| 4.0.1320 | 50 | 9/1/2026 |
| 4.0.1319 | 58 | 9/1/2026 |
| 4.0.1318 | 56 | 9/1/2026 |
| 4.0.1317 | 60 | 9/1/2026 |
| 4.0.1316 | 66 | 9/1/2026 |
| 4.0.1315 | 66 | 9/1/2026 |
| 4.0.1314 | 63 | 9/1/2026 |
| 4.0.1313 | 65 | 9/1/2026 |
| 4.0.1311 | 79 | 8/31/2026 |
| 4.0.1309 | 74 | 8/31/2026 |
Loading failed
Updated Soenneker.Cosmos.Repository to 4.0.8217