EventDriven.DependencyInjection.URF.Mongo
1.3.0
dotnet add package EventDriven.DependencyInjection.URF.Mongo --version 1.3.0
NuGet\Install-Package EventDriven.DependencyInjection.URF.Mongo -Version 1.3.0
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="EventDriven.DependencyInjection.URF.Mongo" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EventDriven.DependencyInjection.URF.Mongo --version 1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EventDriven.DependencyInjection.URF.Mongo, 1.3.0"
#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.
// Install EventDriven.DependencyInjection.URF.Mongo as a Cake Addin #addin nuget:?package=EventDriven.DependencyInjection.URF.Mongo&version=1.3.0 // Install EventDriven.DependencyInjection.URF.Mongo as a Cake Tool #tool nuget:?package=EventDriven.DependencyInjection.URF.Mongo&version=1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EventDriven.DependencyInjection.Mongo
Helper methods for configuring services for MongoDB with dependency injection.
Setup
Package references.
- EventDriven.DependencyInjection.URF.Mongo
appsettings.json file.
{
"MyMongoSettings": {
"ConnectionString": "mongodb://localhost:27017",
"DatabaseName": "SagaConfigDb",
"CollectionName": "MyEntities"
}
}
- Strongly typed app settings class.
public class MyMongoSettings : IMongoDbSettings
{
public string ConnectionString { get; set; } = null!;
public string DatabaseName { get; set; } = null!;
public string CollectionName { get; set; } = null!;
}
- Entity class.
public class MyEntity
{
public Guid Id { get; set; }
public string StringValue { get; set; } = null!;
public int MyIntValue { get; set; }
}
Usage
- In a Web API project.
builder.Services.AddMongoDbSettings<MyMongoSettings, MyEntity>(builder.Configuration);
- In a console project.
var host = Host
.CreateDefaultBuilder(args)
.ConfigureServices(services =>
{
var config = services.BuildServiceProvider()
.GetRequiredService<IConfiguration>();
services.AddMongoDbSettings<MyMongoSettings, MyEntity>(config);
})
.Build();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- EventDriven.DependencyInjection (>= 1.2.0)
- MongoDB.Driver (>= 2.28.0)
- URF.Core.Mongo (>= 8.2.28)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on EventDriven.DependencyInjection.URF.Mongo:
Package | Downloads |
---|---|
EventDriven.SchemaRegistry.Mongo
A mechanism for validating messages against schemas that are stored in a registry by topic name. |
|
EventDriven.EventBus.EventCache.Mongo
A MongoDB implementation of event caching. |
|
EventDriven.EventBus.Dapr.EventCache.Mongo
A MongoDB implementation of event caching with Dapr state store. |
|
EventDriven.Sagas.Persistence.Mongo
A set of abstractions for implementing the Saga pattern. |
|
EventDriven.Sagas.Configuration.Mongo
A set of abstractions for implementing the Saga pattern. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.0 | 227 | 9/18/2024 |
1.2.2 | 74,301 | 9/10/2023 |
1.2.1 | 111,611 | 8/8/2022 |
1.2.0 | 950 | 8/5/2022 |
1.1.0 | 52,392 | 2/26/2022 |
1.1.0-beta4 | 990 | 2/9/2022 |
1.1.0-beta3 | 3,753 | 1/31/2022 |
1.1.0-beta2 | 876 | 1/8/2022 |
1.1.0-beta1 | 194 | 1/7/2022 |
1.0.0-beta2 | 191 | 1/4/2022 |
1.0.0-beta1 | 192 | 1/4/2022 |