Architect.EntityFramework.DbContextManagement
2.0.0
dotnet add package Architect.EntityFramework.DbContextManagement --version 2.0.0
NuGet\Install-Package Architect.EntityFramework.DbContextManagement -Version 2.0.0
<PackageReference Include="Architect.EntityFramework.DbContextManagement" Version="2.0.0" />
paket add Architect.EntityFramework.DbContextManagement --version 2.0.0
#r "nuget: Architect.EntityFramework.DbContextManagement, 2.0.0"
// Install Architect.EntityFramework.DbContextManagement as a Cake Addin #addin nuget:?package=Architect.EntityFramework.DbContextManagement&version=2.0.0 // Install Architect.EntityFramework.DbContextManagement as a Cake Tool #tool nuget:?package=Architect.EntityFramework.DbContextManagement&version=2.0.0
Manage your DbContexts the right way.
The persistence or infrastructure layer uses the DbContext (e.g. from a repository). Controlling its scope and transaction lifetime, however, is ideally the reponsibility of the orchestrating layer (e.g. from an application service). This package adds that ability to Entity Framework Core 5.0.0 and up.
https://github.com/TheArchitectDev/Architect.EntityFramework.DbContextManagement
Release notes:
2.0.0:
- BREAKING: Now using AmbientContexts 2.0.0.
- Semi-breaking: Failure on commit (extremely rare) now throws IOException instead of Exception.
- Added static DbContextScope<TDbContext>.HasDbContext, to match the feature set of IDbContextAccessor.
- Retries now ensure that the connection is closed before retrying, to avoid the risk of leaking session state. (As with EF's DbContext disposal in general, this relies on the database provider's connection reset.)
- Scoped execution now protects against dangerous "failure on commit" retries even on manual commits (rather than just on IExecutionScope's implicit commit).
- Worked around an EF bug where the DbContext would obscure the exception caused by a broken model behind an ObjectDisposedException, even though DbContext._disposed=false.
- Scoped execution: Fixed a bug where the exception caused by a broken model would be obscured behind a wrongful IncompatibleVersionException.
- MockDbContextProvider: Fixed a bug where nested scopes would not work as expected.
- MockDbContextProvider: Fixed a bug where soft attempts to roll back a transaction when there was none could cause an unintended TransactionAbortedException.
1.0.1:
- Now using AmbientContexts 1.1.1, which fixes extremely rare bugs and improves performance.
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.1 is compatible. |
-
.NETCoreApp 3.1
- Architect.AmbientContexts (>= 2.0.0)
- Microsoft.EntityFrameworkCore (>= 5.0.0)
- Microsoft.EntityFrameworkCore.Relational (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.