YAMCqrs.BackgroundWorker.Storage.MongoDb
10.0.2
dotnet add package YAMCqrs.BackgroundWorker.Storage.MongoDb --version 10.0.2
NuGet\Install-Package YAMCqrs.BackgroundWorker.Storage.MongoDb -Version 10.0.2
<PackageReference Include="YAMCqrs.BackgroundWorker.Storage.MongoDb" Version="10.0.2" />
<PackageVersion Include="YAMCqrs.BackgroundWorker.Storage.MongoDb" Version="10.0.2" />
<PackageReference Include="YAMCqrs.BackgroundWorker.Storage.MongoDb" />
paket add YAMCqrs.BackgroundWorker.Storage.MongoDb --version 10.0.2
#r "nuget: YAMCqrs.BackgroundWorker.Storage.MongoDb, 10.0.2"
#:package YAMCqrs.BackgroundWorker.Storage.MongoDb@10.0.2
#addin nuget:?package=YAMCqrs.BackgroundWorker.Storage.MongoDb&version=10.0.2
#tool nuget:?package=YAMCqrs.BackgroundWorker.Storage.MongoDb&version=10.0.2
YAMCqrs.BackgroundWorker.Storage.MongoDb
This package provides a persistent storage implementation for the YAMCqrs BackgroundWorker project using MongoDB. It allows background task execution history to be stored for auditing purposes and health check calculations.
⚙️ Installation
dotnet add package YAMCqrs.BackgroundWorker.Storage.MondgoDb
🚀 Quick Start
To register MongoDB storage in your dependency container:
builder.Services.AddBackgroundWorker(options =>
{
// Configuration for the core BackgroundWorker library.
// For more details, see its corresponding documentation.
})
.UseMongoDb(new BackgroundWorkerMongoConfiguration
{
ConnectionString = "cs_MongoDb",
DatabaseName = "TestAppDb",
});
By using "cs_MongoDb" as the ConnectionString, we are telling the library to look up the actual value inside the "ConnectionStrings" section using the MongoDb key, as defined in ADR 13
⚙️ Configuration
- ConnectionString: Connection string used to connect to MongoDB.
- DatabaseName: Name of the database to use.
🛠️ Implementation Details
- Indexes: Automatically created.
- Collections: The MongoDB instance must allow automatic collection creation.
📋 Dependencies
- MongoDB.Driver
YAMCqrs.BackgroundWorkerproject
💡 Example DB Document
Events are persisted in the WorkerExecutions collection with the following structure:
{
"_id": "019e3215-a171-7ff2-880a-14597e93cde0",
"WorkerName": "YAMCqrs.BackgroundWorker.Implementation.CleanBackGroundWorker",
"ExecutionStartTime": {
"$date": "2026-05-16T18:38:58.929Z"
},
"ExecutionEndTime": {
"$date": "2026-05-16T18:38:59.163Z"
},
"Status": "Success",
"Success": 1,
"Failed": 0,
"Message": ""
}
| 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. |
-
net10.0
- MongoDB.Driver (>= 3.8.1)
- SharpCompress (>= 0.48.1)
- YAMCqrs.BackgroundWorker.Core (>= 10.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.