16 packages tagged with “DbContextScope”
DbContextScope was created out of the need for a better way to manage DbContext instances in Entity Framework-based applications.
DbContextSCope package for EF6 and EFCore. Forked from https://github.com/mehdime/DbContextScope. Compatible with .net 4.0+ (EF6) and .net Standard 1.3+ (EFCore). Credit also to https://github.com/ninety7 for code regarding refreshing parent entities.
DbContextScope for EF v2|v3 Core. Forked from https://github.com/tncalvert/DbContextScope.
DbContextScope for EF Core. Forked from https://github.com/mehdime/DbContextScope.
DbContextScope for EF Core 5 and .Net Standard 2.1. Forked from https://github.com/mehdime/DbContextScope.
A library for managing the lifetime of Entity Framework Core 6 DbContext instances. This package is based on the original DbContextScope repository by Mehdi El Gueddari, updated for .NET 6 and EF Core 6, with a number of additional improvements and bug fixes.
DbContextScope is a simple and flexible way to manage your Entity Framework Core relational DbContext instances.
Extending from Mehdime.Entity :https://www.nuget.org/packages/Mehdime.Entity/ Add Transaction Committed Event
A library for managing the lifetime of Entity Framework Core DbContext instances. This package is based on the original DbContextScope repository by Mehdi El Gueddari, updated for .NET 6+ and EF Core, with a number of additional improvements and bug fixes.
DbContextScope for EF Core 3.x. Forked from https://github.com/mehdime/DbContextScope.
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.1: - Enhancement: Upgraded package versions. 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.
This package provides a way to implement Unit Of Work and Repository patterns with Entity Framework Core and DbContextScope.
Extension for EntityFrameworkCore.DbContextScope.
AdoScope (Official): A simple and flexible way to manage your ADO database connections and transactions. Based on DbContextScope but for general ADO including Dapper. Please README.md for usage details. public void ServiceLayerAddTestEntity() { using IAdoScope adoScope = adoScopeFactory.Create(); // Create a test entity var newTestEntity = new TestEntity { Name = "CreateTest", Description = "Test Description", Quantity = 1 }; // Call our repository to add the entity simpleTestRepository.Add(newTestEntity); // Commit the unit of work / transaction (if using ExecutionOption.Transactional) adoScope.Complete(); }