AWLMongoWrapper 1.0.0
See the version list below for details.
dotnet add package AWLMongoWrapper --version 1.0.0
NuGet\Install-Package AWLMongoWrapper -Version 1.0.0
<PackageReference Include="AWLMongoWrapper" Version="1.0.0" />
paket add AWLMongoWrapper --version 1.0.0
#r "nuget: AWLMongoWrapper, 1.0.0"
// Install AWLMongoWrapper as a Cake Addin #addin nuget:?package=AWLMongoWrapper&version=1.0.0 // Install AWLMongoWrapper as a Cake Tool #tool nuget:?package=AWLMongoWrapper&version=1.0.0
MongoWrapper
Basic MongoDB wrapper to allow a reusable instance of a Mongo DB instance with CRUD control.
Installation
There are two required settings that must be made available through app settings. Those settings are as follows:
{
"MongoWrapper": {
"ConnectionString": "MongoDB Connection String",
"DatabaseName": "Target Database Name"
}
}
Usage
To initialise the connection to the datase, the method AddMongoWrapper
should be called passing in an IConfiguration
instance that contains the above configuration settings.
I.e. .AddMongoWrapper(_configuration);
To then utilise the connection provided, ensure the interface IDatabaseService
is injected wherever it needs to be utilised. This can then be referenced to complete basic CRUD operations on the database for a given target collection.
I.e.
private readonly IDatabaseService _databaseService;
public MyRepository (IDatabaseService databaseService) {
_databaseService = databaseService;
}
public Task<List<Entity>> MyMethod =>
_databaseService.ReadEntities<Entity>("MyCollectionName");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net6.0
- Microsoft.Extensions.Configuration (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- MongoDB.Driver (>= 2.19.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.