diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index f1635bb..d2d522b 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,10 +3,11 @@ "isRoot": true, "tools": { "csharpier": { - "version": "0.26.2", + "version": "0.30.6", "commands": [ "dotnet-csharpier" - ] + ], + "rollForward": false } } } \ No newline at end of file diff --git a/.editorconfig b/.editorconfig index 3d6db45..39d04fe 100644 --- a/.editorconfig +++ b/.editorconfig @@ -125,5 +125,8 @@ dotnet_diagnostic.SA1633.severity = none # IDE0063: Use simple 'using' statement dotnet_diagnostic.IDE0063.severity = none +# IDE0300: Collection initialization can be simplified +dotnet_diagnostic.IDE0300.severity = none + # SA1009: Closing parenthesis should be spaced correctly dotnet_diagnostic.SA1009.severity = none \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 13a5847..57724ae 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -60,7 +60,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.0.x' + dotnet-version: '9.0.x' dotnet-quality: 'ga' # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b8f6b2e..a341849 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -15,7 +15,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.0.x' + dotnet-version: '9.0.x' dotnet-quality: 'ga' - name: Restore dependencies run: dotnet restore @@ -35,7 +35,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: '8.0.x' + dotnet-version: '9.0.x' dotnet-quality: 'ga' - name: Restore dependencies run: dotnet restore diff --git a/DbContextScope.Tests/DbContextScope.Tests.csproj b/DbContextScope.Tests/DbContextScope.Tests.csproj index e514988..4528627 100644 --- a/DbContextScope.Tests/DbContextScope.Tests.csproj +++ b/DbContextScope.Tests/DbContextScope.Tests.csproj @@ -1,22 +1,22 @@ - net8.0 + net9.0 enable false - - - + + + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/DbContextScope.Tests/DbContextScopeTests.cs b/DbContextScope.Tests/DbContextScopeTests.cs index 072422b..be60d10 100644 --- a/DbContextScope.Tests/DbContextScopeTests.cs +++ b/DbContextScope.Tests/DbContextScopeTests.cs @@ -1,11 +1,11 @@ -using DbContextScope.Exceptions; -using FluentAssertions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Concurrent; using System.Linq; using System.Reflection; using System.Threading.Tasks; +using DbContextScope.Exceptions; +using Microsoft.EntityFrameworkCore; +using Shouldly; using Xunit; using Zejji.Entity; using Zejji.Tests.Helpers; @@ -16,7 +16,7 @@ namespace Zejji.Tests; public sealed class DbContextScopeTests : IDisposable { private readonly SqliteMemoryDatabaseLifetimeManager _databaseManager; - private readonly IDbContextFactory _dbContextFactory; + private readonly TestDbContextFactory _dbContextFactory; private readonly DbContextScopeFactory _dbContextScopeFactory; public DbContextScopeTests() @@ -52,10 +52,10 @@ public void Nested_scopes_should_use_same_DbContext_by_default() { var innerDbContext = innerDbContextScope.DbContexts.Get(); - outerDbContext.Should().NotBeNull(); - innerDbContext.Should().NotBeNull(); + outerDbContext.ShouldNotBeNull(); + innerDbContext.ShouldNotBeNull(); - innerDbContext.Should().BeSameAs(outerDbContext); + innerDbContext.ShouldBeSameAs(outerDbContext); } } } @@ -69,8 +69,8 @@ public void Calling_GetRequired_on_an_AmbientDbContextLocator_outside_of_an_ambi contextLocator.GetRequired(); }); - ex.Should().NotBeNull(); - ex.Should().BeOfType(); + ex.ShouldNotBeNull(); + ex.ShouldBeOfType(); } [Fact] @@ -102,7 +102,7 @@ public void Calling_SaveChanges_on_a_nested_scope_has_no_effect() using (var dbContext = _dbContextFactory.CreateDbContext()) { var user = dbContext.Users.Single(); - user.Name.Should().Be(originalName); + user.Name.ShouldBe(originalName); } } @@ -132,7 +132,7 @@ public void Calling_SaveChanges_on_the_outer_scope_saves_changes() using (var dbContext = _dbContextFactory.CreateDbContext()) { var user = dbContext.Users.Single(); - user.Name.Should().Be(newName); + user.Name.ShouldBe(newName); } } @@ -154,8 +154,8 @@ public void Changes_can_only_be_saved_once_on_a_DbContextScope() }); // Assert - an InvalidOperationException should have been thrown - ex.Should().NotBeNull(); - ex.Should().BeOfType(); + ex.ShouldNotBeNull(); + ex.ShouldBeOfType(); } } @@ -227,11 +227,11 @@ public void SaveChanges_can_be_called_again_after_a_DbUpdateConcurrencyException } // Assert - concurrencyExceptionThrown.Should().Be(true); + concurrencyExceptionThrown.ShouldBe(true); using (var dbContext = _dbContextFactory.CreateDbContext()) { var user = dbContext.Users.Single(); - user.Name.Should().Be(newName2); + user.Name.ShouldBe(newName2); } } @@ -246,7 +246,7 @@ public void IDbContextReadOnlyScope_should_not_have_SaveChanges_method() BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly ); var saveChangesMethod = publicMethods.SingleOrDefault(m => m.Name == "SaveChanges"); - saveChangesMethod.Should().BeNull(); + saveChangesMethod.ShouldBeNull(); } } @@ -260,8 +260,8 @@ public void AmbientDbContextLocator_should_return_ambient_scope() var contextLocator = new AmbientDbContextLocator(); var ambientDbContext = contextLocator.Get(); - ambientDbContext.Should().NotBeNull(); - ambientDbContext.Should().BeSameAs(dbContext); + ambientDbContext.ShouldNotBeNull(); + ambientDbContext.ShouldBeSameAs(dbContext); } } @@ -280,10 +280,10 @@ public void ForceCreateNew_option_should_create_new_DbContext_in_nested_scope() { var innerDbContext = innerDbContextScope.DbContexts.Get(); - outerDbContext.Should().NotBeNull(); - innerDbContext.Should().NotBeNull(); + outerDbContext.ShouldNotBeNull(); + innerDbContext.ShouldNotBeNull(); - innerDbContext.Should().NotBeSameAs(outerDbContext); + innerDbContext.ShouldNotBeSameAs(outerDbContext); } } } @@ -311,7 +311,7 @@ public void RefreshEntitiesInParentScope_should_reload_changed_data_from_databas var outerDbContext = outerDbContextScope.DbContexts.Get(); var outerUsers = outerDbContext.Users.ToList(); - outerUsers.Count.Should().Be(2); + outerUsers.Count.ShouldBe(2); // Arrange - modify the entity in an inner scope created with ForceCreateNew using ( @@ -329,15 +329,15 @@ public void RefreshEntitiesInParentScope_should_reload_changed_data_from_databas // Entities in outer scope should be unchanged at this point // since we have not refreshed the entities yet - outerUsers[0].Name.Should().Be(originalName1); - outerUsers[1].Name.Should().Be(originalName2); + outerUsers[0].Name.ShouldBe(originalName1); + outerUsers[1].Name.ShouldBe(originalName2); // Act - only refresh first user in parent scope, but not the second innerDbContextScope.RefreshEntitiesInParentScope(new User[] { innerUsers[0] }); // Assert - outerUsers[0].Name.Should().Be(newName1); - outerUsers[1].Name.Should().Be(originalName2); + outerUsers[0].Name.ShouldBe(newName1); + outerUsers[1].Name.ShouldBe(originalName2); } } } @@ -358,16 +358,16 @@ public void RefreshEntitiesInParentScope_should_refresh_entities_with_composite_ CoursesUsers = new CourseUser[] { new() { Course = course1, Grade = "A" }, - new() { Course = course2, Grade = "C" } - } + new() { Course = course2, Grade = "C" }, + }, }, new() { Name = "Test User 2", CoursesUsers = new CourseUser[] { - new() { Course = course1, Grade = "F" } - } + new() { Course = course1, Grade = "F" }, + }, } ); dbContext.SaveChanges(); @@ -376,12 +376,12 @@ public void RefreshEntitiesInParentScope_should_refresh_entities_with_composite_ using (var outerDbContextScope = _dbContextScopeFactory.Create()) { var outerDbContext = outerDbContextScope.DbContexts.Get(); - var outerUsers = outerDbContext.Users - .Include(u => u.CoursesUsers) + var outerUsers = outerDbContext + .Users.Include(u => u.CoursesUsers) .ThenInclude(cu => cu.Course) .ToList(); - outerUsers.Count.Should().Be(2); + outerUsers.Count.ShouldBe(2); // Arrange(2) - modify the CourseUser entities in an inner scope created with ForceCreateNew using ( @@ -391,8 +391,8 @@ public void RefreshEntitiesInParentScope_should_refresh_entities_with_composite_ ) { var innerDbContext = innerDbContextScope.DbContexts.Get(); - var innerUsers = innerDbContext.Users - .Include(u => u.CoursesUsers) + var innerUsers = innerDbContext + .Users.Include(u => u.CoursesUsers) .ThenInclude(cu => cu.Course) .ToList(); @@ -408,11 +408,11 @@ public void RefreshEntitiesInParentScope_should_refresh_entities_with_composite_ // Entities in outer scope should be unchanged at this point // since we have not refreshed the entities yet var outerUser1CoursesUsers = outerUsers[0].CoursesUsers.ToList(); - outerUser1CoursesUsers[0].Grade.Should().Be("A"); - outerUser1CoursesUsers[1].Grade.Should().Be("C"); + outerUser1CoursesUsers[0].Grade.ShouldBe("A"); + outerUser1CoursesUsers[1].Grade.ShouldBe("C"); var outerUser2CoursesUsers = outerUsers[1].CoursesUsers.ToList(); - outerUser2CoursesUsers[0].Grade.Should().Be("F"); + outerUser2CoursesUsers[0].Grade.ShouldBe("F"); // Act - only refresh the first user's CoursesUsers in the parent scope, // but NOT the second user's @@ -421,9 +421,9 @@ public void RefreshEntitiesInParentScope_should_refresh_entities_with_composite_ ); // Assert - outerUser1CoursesUsers[0].Grade.Should().Be("B"); // new value - outerUser1CoursesUsers[1].Grade.Should().Be("D"); // new value - outerUser2CoursesUsers[0].Grade.Should().Be("F"); // unchanged from original value + outerUser1CoursesUsers[0].Grade.ShouldBe("B"); // new value + outerUser1CoursesUsers[1].Grade.ShouldBe("D"); // new value + outerUser2CoursesUsers[0].Grade.ShouldBe("F"); // unchanged from original value } } } @@ -433,11 +433,11 @@ public void Calling_SuppressAmbientContext_should_suppress_ambient_DbContextScop { using (var dbContextScope = _dbContextScopeFactory.Create()) { - dbContextScope.Should().NotBeNull(); + dbContextScope.ShouldNotBeNull(); var outerAmbientContextLocator = new AmbientDbContextLocator(); var outerContext1 = outerAmbientContextLocator.Get(); - outerContext1.Should().NotBeNull(); + outerContext1.ShouldNotBeNull(); using (var suppressor = _dbContextScopeFactory.SuppressAmbientContext()) { @@ -446,24 +446,24 @@ public void Calling_SuppressAmbientContext_should_suppress_ambient_DbContextScop // Since we have suppressed the ambient DbContextScope here, we should // not be able to get a DbContext from the innerAmbientContextLocator var suppressedContext = suppressedAmbientContextLocator.Get(); - suppressedContext.Should().BeNull(); + suppressedContext.ShouldBeNull(); // And any new DbContextScope should not join the existing one using (var innerDbContextScope = _dbContextScopeFactory.Create()) { - innerDbContextScope.Should().NotBeNull(); + innerDbContextScope.ShouldNotBeNull(); var innerAmbientContextLocator = new AmbientDbContextLocator(); var innerContext = innerAmbientContextLocator.Get(); - innerContext.Should().NotBeNull(); - innerContext.Should().NotBeSameAs(outerContext1); + innerContext.ShouldNotBeNull(); + innerContext.ShouldNotBeSameAs(outerContext1); } } // The original ambient DbContextScope should be restored here var outerContext2 = outerAmbientContextLocator.Get(); - outerContext1.Should().NotBeNull(); - outerContext2.Should().BeSameAs(outerContext1); + outerContext1.ShouldNotBeNull(); + outerContext2.ShouldBeSameAs(outerContext1); } } @@ -485,13 +485,13 @@ public void Multiple_threads_which_create_a_DbContextScope_use_separate_DbContex { using (var dbContextScope = _dbContextScopeFactory.Create()) { - dbContextScope.Should().NotBeNull(); + dbContextScope.ShouldNotBeNull(); var dbContextScopeId = dbContextScope.GetHashCode(); dbContextScopeIds.Add(dbContextScopeId); var dbContext = dbContextScope.DbContexts.Get(); - dbContext.Should().NotBeNull(); + dbContext.ShouldNotBeNull(); var dbContextId = dbContext.GetHashCode(); dbContextIds.Add(dbContextId); @@ -500,10 +500,10 @@ public void Multiple_threads_which_create_a_DbContextScope_use_separate_DbContex ); // We should have a unique DbContextScope and DbContext for each thread - dbContextScopeIds.Count.Should().Be(threadCount); - dbContextIds.Count.Should().Be(threadCount); + dbContextScopeIds.Count.ShouldBe(threadCount); + dbContextIds.Count.ShouldBe(threadCount); - dbContextScopeIds.Should().OnlyHaveUniqueItems(); - dbContextIds.Should().OnlyHaveUniqueItems(); + dbContextScopeIds.ShouldBeUnique(); + dbContextIds.ShouldBeUnique(); } } diff --git a/DbContextScope.Tests/Helpers/SqliteMemoryDatabaseLifetimeManager.cs b/DbContextScope.Tests/Helpers/SqliteMemoryDatabaseLifetimeManager.cs index 62f563a..bc827ed 100644 --- a/DbContextScope.Tests/Helpers/SqliteMemoryDatabaseLifetimeManager.cs +++ b/DbContextScope.Tests/Helpers/SqliteMemoryDatabaseLifetimeManager.cs @@ -1,6 +1,6 @@ -using Microsoft.Data.Sqlite; -using System; +using System; using System.Data.Common; +using Microsoft.Data.Sqlite; namespace Zejji.Tests.Helpers { diff --git a/DbContextScope.Tests/Helpers/TestDbContextFactory.cs b/DbContextScope.Tests/Helpers/TestDbContextFactory.cs index 4778486..0ec9954 100644 --- a/DbContextScope.Tests/Helpers/TestDbContextFactory.cs +++ b/DbContextScope.Tests/Helpers/TestDbContextFactory.cs @@ -1,5 +1,5 @@ -using Microsoft.EntityFrameworkCore; -using System; +using System; +using Microsoft.EntityFrameworkCore; using Zejji.Entity; using Zejji.Tests.Models; diff --git a/DbContextScope.Tests/RegisteredDbContextFactoryTests.cs b/DbContextScope.Tests/RegisteredDbContextFactoryTests.cs index d08deca..c17ae16 100644 --- a/DbContextScope.Tests/RegisteredDbContextFactoryTests.cs +++ b/DbContextScope.Tests/RegisteredDbContextFactoryTests.cs @@ -1,6 +1,6 @@ -using FluentAssertions; +using System; using Microsoft.EntityFrameworkCore; -using System; +using Shouldly; using Xunit; using Zejji.Entity; using Zejji.Tests.Helpers; @@ -52,24 +52,24 @@ public void RegisteredDbContextFactory_should_call_registered_factory_function_f var emptyDbContext = _dbContextFactory.CreateDbContext(); // Assert - testDbContextFactoryCallCount.Should().Be(2); - emptyDbContextFactoryCallCount.Should().Be(1); + testDbContextFactoryCallCount.ShouldBe(2); + emptyDbContextFactoryCallCount.ShouldBe(1); - testDbContext1.Should().NotBeNull(); - testDbContext2.Should().NotBeNull(); - emptyDbContext.Should().NotBeNull(); + testDbContext1.ShouldNotBeNull(); + testDbContext2.ShouldNotBeNull(); + emptyDbContext.ShouldNotBeNull(); - testDbContext1.Should().NotBeSameAs(testDbContext2); + testDbContext1.ShouldNotBeSameAs(testDbContext2); - var testDbContext1ConnectionString = testDbContext1.Database - .GetDbConnection() + var testDbContext1ConnectionString = testDbContext1 + .Database.GetDbConnection() .ConnectionString; - testDbContext1ConnectionString.Should().Be(connectionString); + testDbContext1ConnectionString.ShouldBe(connectionString); - var testDbContext2ConnectionString = testDbContext2.Database - .GetDbConnection() + var testDbContext2ConnectionString = testDbContext2 + .Database.GetDbConnection() .ConnectionString; - testDbContext2ConnectionString.Should().Be(connectionString); + testDbContext2ConnectionString.ShouldBe(connectionString); } } } diff --git a/DbContextScope/DbContextScope.csproj b/DbContextScope/DbContextScope.csproj index 4915fe6..07e386b 100644 --- a/DbContextScope/DbContextScope.csproj +++ b/DbContextScope/DbContextScope.csproj @@ -1,17 +1,17 @@ - net8.0 + net8.0;net9.0 enable Zejji.DbContextScope.EFCore - 8.0.100.1 + 9.0.1.0 Mehdi El Gueddari;Gerard Howell DbContextScope;DbContext;EF;EFCore;EntityFramework;EntityFrameworkCore;UnitOfWork;AmbientDbContext;AmbientContext;RepositoryPattern 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. LICENSE.txt README.md https://github.com/zejji/DbContextScopeEFCore - Copyright (c) 2014 Mehdi El Gueddari; (c) 2023 Gerard Howell + Copyright (c) 2014 Mehdi El Gueddari; (c) 2025 Gerard Howell git true true @@ -22,8 +22,8 @@ - - + + diff --git a/DbContextScope/Enums/DbContextScopeOption.cs b/DbContextScope/Enums/DbContextScopeOption.cs index 151d2ca..08794e6 100644 --- a/DbContextScope/Enums/DbContextScopeOption.cs +++ b/DbContextScope/Enums/DbContextScopeOption.cs @@ -39,6 +39,6 @@ public enum DbContextScopeOption /// cannot be rolled back or to persist audit or log entries that must not be rolled back /// regardless of the outcome of the business transaction). /// - ForceCreateNew + ForceCreateNew, } } diff --git a/DbContextScope/Implementations/DbContextCollection.cs b/DbContextScope/Implementations/DbContextCollection.cs index 9142c56..408835d 100644 --- a/DbContextScope/Implementations/DbContextCollection.cs +++ b/DbContextScope/Implementations/DbContextCollection.cs @@ -1,11 +1,11 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using System; +using System; using System.Collections.Generic; using System.Data; using System.Runtime.ExceptionServices; using System.Threading; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Storage; namespace Zejji.Entity { diff --git a/DbContextScope/Implementations/DbContextReadOnlyScope.cs b/DbContextScope/Implementations/DbContextReadOnlyScope.cs index b31cfe9..b1bffd7 100644 --- a/DbContextScope/Implementations/DbContextReadOnlyScope.cs +++ b/DbContextScope/Implementations/DbContextReadOnlyScope.cs @@ -8,13 +8,12 @@ public class DbContextReadOnlyScope( IDbContextFactory? dbContextFactory = null ) : IDbContextReadOnlyScope { - private readonly DbContextScope _internalScope = - new( - joiningOption: joiningOption, - readOnly: true, - isolationLevel: isolationLevel, - dbContextFactory: dbContextFactory - ); + private readonly DbContextScope _internalScope = new( + joiningOption: joiningOption, + readOnly: true, + isolationLevel: isolationLevel, + dbContextFactory: dbContextFactory + ); public IDbContextCollection DbContexts => _internalScope.DbContexts; diff --git a/DbContextScope/Implementations/DbContextScope.cs b/DbContextScope/Implementations/DbContextScope.cs index 8f981b3..4af28a1 100644 --- a/DbContextScope/Implementations/DbContextScope.cs +++ b/DbContextScope/Implementations/DbContextScope.cs @@ -1,12 +1,12 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.ChangeTracking; -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Linq; using System.Threading; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.ChangeTracking; namespace Zejji.Entity { @@ -207,8 +207,8 @@ IEnumerable entities // Get the primary key properties. // Note that entities may have composite primary keys. - var primaryKeyProperties = stateInCurrentScope.Metadata - ?.FindPrimaryKey() + var primaryKeyProperties = stateInCurrentScope + .Metadata?.FindPrimaryKey() ?.Properties.ToArray(); if (primaryKeyProperties == null || primaryKeyProperties.Length == 0) @@ -220,15 +220,10 @@ IEnumerable entities // Create a map of primary key name(s) to their value(s). var primaryKeyValues = primaryKeyProperties - .Select( - p => - new KeyValuePair( - p.Name, - entityType - .GetProperty(p.Name) - ?.GetValue(stateInCurrentScope.Entity) - ) - ) + .Select(p => new KeyValuePair( + p.Name, + entityType.GetProperty(p.Name)?.GetValue(stateInCurrentScope.Entity) + )) .ToArray(); // Look for the corresponding entry in the parent context. @@ -244,8 +239,7 @@ where e.Entity.GetType() == stateInCurrentScope.Entity.GetType() source = from e in source where - e.Entity - .GetType() + e.Entity.GetType() .GetProperty(primaryKeyNameAndValue.Key) ?.GetValue(e.Entity) ?.Equals(primaryKeyNameAndValue.Value) ?? false diff --git a/DbContextScope/Implementations/RegisteredDbContextFactory.cs b/DbContextScope/Implementations/RegisteredDbContextFactory.cs index 07bd9cf..8dad54d 100644 --- a/DbContextScope/Implementations/RegisteredDbContextFactory.cs +++ b/DbContextScope/Implementations/RegisteredDbContextFactory.cs @@ -1,5 +1,5 @@ -using Microsoft.EntityFrameworkCore; -using System; +using System; +using Microsoft.EntityFrameworkCore; namespace Zejji.Entity { diff --git a/DbContextScope/Implementations/ServiceProviderDbContextFactory.cs b/DbContextScope/Implementations/ServiceProviderDbContextFactory.cs index 049d782..616b137 100644 --- a/DbContextScope/Implementations/ServiceProviderDbContextFactory.cs +++ b/DbContextScope/Implementations/ServiceProviderDbContextFactory.cs @@ -1,6 +1,6 @@ -using Microsoft.EntityFrameworkCore; +using System; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; -using System; namespace Zejji.Entity; @@ -11,8 +11,7 @@ namespace Zejji.Entity; /// /// It should be registered in a dependency injection container as a singleton. /// -public class ServiceProviderDbContextFactory(IServiceProvider serviceProvider) - : IDbContextFactory +public class ServiceProviderDbContextFactory(IServiceProvider serviceProvider) : IDbContextFactory { public TDbContext CreateDbContext() where TDbContext : DbContext diff --git a/DbContextScope/Interfaces/IDbContextCollection.cs b/DbContextScope/Interfaces/IDbContextCollection.cs index 7e584ae..98598bf 100644 --- a/DbContextScope/Interfaces/IDbContextCollection.cs +++ b/DbContextScope/Interfaces/IDbContextCollection.cs @@ -1,5 +1,5 @@ -using Microsoft.EntityFrameworkCore; -using System; +using System; +using Microsoft.EntityFrameworkCore; namespace Zejji.Entity { diff --git a/DbContextScope/Interfaces/IDbContextReadOnlyScope.cs b/DbContextScope/Interfaces/IDbContextReadOnlyScope.cs index fd4b526..5aaa77d 100644 --- a/DbContextScope/Interfaces/IDbContextReadOnlyScope.cs +++ b/DbContextScope/Interfaces/IDbContextReadOnlyScope.cs @@ -1,5 +1,5 @@ -using Microsoft.EntityFrameworkCore; -using System; +using System; +using Microsoft.EntityFrameworkCore; namespace Zejji.Entity { diff --git a/DbContextScope/Interfaces/IDbContextScope.cs b/DbContextScope/Interfaces/IDbContextScope.cs index 75b4c5c..63ecc18 100644 --- a/DbContextScope/Interfaces/IDbContextScope.cs +++ b/DbContextScope/Interfaces/IDbContextScope.cs @@ -1,8 +1,8 @@ -using Microsoft.EntityFrameworkCore; -using System; +using System; using System.Collections; using System.Threading; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; namespace Zejji.Entity { diff --git a/DbContextScope/Interfaces/IDbContextScopeFactory.cs b/DbContextScope/Interfaces/IDbContextScopeFactory.cs index cf2b21b..8d99034 100644 --- a/DbContextScope/Interfaces/IDbContextScopeFactory.cs +++ b/DbContextScope/Interfaces/IDbContextScopeFactory.cs @@ -1,6 +1,6 @@ -using Microsoft.EntityFrameworkCore; -using System; +using System; using System.Data; +using Microsoft.EntityFrameworkCore; namespace Zejji.Entity { diff --git a/global.json b/global.json index f3365c4..f54920f 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "8.0.100" + "version": "9.0.101" } } \ No newline at end of file