Mubai.UnitOfWork
1.0.1
dotnet add package Mubai.UnitOfWork --version 1.0.1
NuGet\Install-Package Mubai.UnitOfWork -Version 1.0.1
<PackageReference Include="Mubai.UnitOfWork" Version="1.0.1" />
<PackageVersion Include="Mubai.UnitOfWork" Version="1.0.1" />
<PackageReference Include="Mubai.UnitOfWork" />
paket add Mubai.UnitOfWork --version 1.0.1
#r "nuget: Mubai.UnitOfWork, 1.0.1"
#:package Mubai.UnitOfWork@1.0.1
#addin nuget:?package=Mubai.UnitOfWork&version=1.0.1
#tool nuget:?package=Mubai.UnitOfWork&version=1.0.1
Mubai.UnitOfWork
English | 简体中文
About
Interfaces for a simple Unit of Work pattern. It exposes the minimal contract IUnitOfWork for transactional workflows; you can provide your own data-provider implementation. For EF Core usage, see the separate Mubai.UnitOfWork.EntityFrameworkCore package.
How to Use
Reference this project/package and register your own implementation of IUnitOfWork.
Automated Execution
Use ExecuteInTransactionAsync to complete the transaction by wrapping business operations.
await unitOfWork.ExecuteInTransactionAsync(async ct =>
{
// perform data changes
await unitOfWork.SaveChangesAsync(ct);
});
Manual control
Manually control boundaries with BeginTransactionAsync / CommitAsync / RollbackAsync.
if (await unitOfWork.BeginTransactionAsync())
{
try
{
// business work
await unitOfWork.SaveChangesAsync();
await unitOfWork.CommitAsync();
}
catch
{
await unitOfWork.RollbackAsync();
throw;
}
}
Requirements
- .NET Standard 2.0
| 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. 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.0
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- System.Threading.Tasks.Extensions (>= 4.5.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Mubai.UnitOfWork:
| Package | Downloads |
|---|---|
|
Mubai.UnitOfWork.EntityFrameworkCore
Entity Framework Core implementation of Mubai.UnitOfWork. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release of Mubai.UnitOfWork interfaces with transaction helpers.