Robotico.Repository.MongoDb 0.1.4

Robotico.Repository.MongoDb

Woodpecker CI

IRepository<TEntity, TId>, IAsyncRepository<TEntity, TId>, and IUnitOfWork backed by MongoDB.Driver using IMongoCollection<TEntity> and optional IClientSessionHandle.

Which interface?

Host / scenario Prefer
ASP.NET Core, workers IAsyncRepository<,>
Legacy synchronous usage IRepository<,>

Unit of work profile (IUnitOfWorkCapabilities)

Applies to MongoDbUnitOfWork (session transaction). Without a session, repository writes are immediate per operation.

UnitOfWorkCommitMode SessionScopedTransaction
CommitCoordinatesDomainWrites yes when using a session + MongoDbUnitOfWork
SupportsTransactions yes

.NET 8 .NET 10 C# GitHub Packages

Session and transaction

Use the same IClientSessionHandle for MongoDbRepository and MongoDbUnitOfWork so that repository operations and commit participate in one transaction. Start the session with client.StartSession() and session.StartTransaction() before using repositories; pass the session to both the repository constructor and the unit of work. Call CommitAsync to commit the transaction.

License

See repository license file.

No packages depend on Robotico.Repository.MongoDb.

.NET 8.0

.NET 10.0

Version Downloads Last updated
0.1.4 1 07/26/2026
0.1.3 3 06/03/2026