Twileloop.UOW.MongoDB
2.2.0
Prefix Reserved
See the version list below for details.
dotnet add package Twileloop.UOW.MongoDB --version 2.2.0
NuGet\Install-Package Twileloop.UOW.MongoDB -Version 2.2.0
<PackageReference Include="Twileloop.UOW.MongoDB" Version="2.2.0" />
paket add Twileloop.UOW.MongoDB --version 2.2.0
#r "nuget: Twileloop.UOW.MongoDB, 2.2.0"
// Install Twileloop.UOW.MongoDB as a Cake Addin #addin nuget:?package=Twileloop.UOW.MongoDB&version=2.2.0 // Install Twileloop.UOW.MongoDB as a Cake Tool #tool nuget:?package=Twileloop.UOW.MongoDB&version=2.2.0
<br /> <div align="center"> <a href="https://github.com/sangeethnandakumar/Twileloop.UOW"> <img src="https://iili.io/HPIj6ss.png" alt="Logo" width="80" height="80"> </a>
<h2 align="center"> Twileloop UOW</h2> <h4 align="center"> Free | Open-Source | Fast </h4> </div>
About
A lightweight and ready-made implementation of unit of work pattern + and a NoSQL database like LiteDB or MongoDB. With ability to use multiple LiteDB or MongoDB databases, ready-made CRUD operations repository and thread-safe features.
License
Twileloop.UOW.LiteDB - is licensed under the MIT License. See the LICENSE file for more details.
Twileloop.UOW.MongoDB - is licensed under the MIT License. See the LICENSE file for more details.
This library is absolutely free. If it gives you a smile, A small coffee would be a great way to support my work. Thank you for considering it!
Integration Guide
Read full integration guide: https://packages.twileloop.com/Twileloop.UOW
1. Register all databases to ASP.NET dependency injection
//LiteDB
builder.Services.AddUnitOfWork((uow) => {
uow.Connections = new List<LiteDBConnection>
{
new LiteDBConnection("DatabaseA", "Filename=DatabaseA.db; Mode=Shared; Password=****;"),
new LiteDBConnection("DatabaseB", "Filename=DatabaseB.db; Mode=Shared; Password=****;")
};
});
//MongoDB
builder.Services.AddUnitOfWork((uow) => {
uow.Connections = new List<MongoDBConnection>
{
new MongoDBConnection("DatabaseA", "mongodb+srv://Uername:****@Cluster"),
new MongoDBConnection("DatabaseB", "mongodb+srv://Uername:****@Cluster")
};
});
2. For No Dependency Injection Setup
//LiteDB
var context = LiteDB.Support.Extensions.BuildDbContext(option =>
{
option.Connections = new List<LiteDBConnection>
{
new LiteDBConnection("DatabaseA", "Filename=DatabaseA.db; Mode=Shared; Password=****;"),
new LiteDBConnection("DatabaseB", "Filename=DatabaseB.db; Mode=Shared; Password=****;")
};
});
var uow = new LiteDB.Core.UnitOfWork(context);
//MongoDB
var context = MongoDB.Support.Extensions.BuildDbContext(option =>
{
option.Connections = new List<MongoDBConnection>
{
new MongoDBConnection("DatabaseA", "mongodb+srv://Username:****@Cluster"),
new MongoDBConnection("DatabaseB", "mongodb+srv://Username:****@Cluster")
};
});
var uow = new MongoDB.Core.UnitOfWork(context);
2. Inject and Use as required
[ApiController]
public class HomeController : ControllerBase
{
private readonly UnitOfWork uow;
public HomeController(UnitOfWork uow)
{
this.uow = uow;
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- Humanizer (>= 2.14.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- MongoDB.Driver (>= 2.19.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.