Repository: ErikEJ/EFCorePowerTools (2026-04-17T05:41:48Z)

Issue:
Enable support for Sqlite.Nodatime in EF Core 10 tools
`<PackageReference Include="EntityFrameworkCore.Sqlite.NodaTime" Version="10.0.0" />`

Update serviceproviders.cs and also update providers.cs accordingy


Discussion:

Patch:
diff --git a/.github/workflows/vsix.yml b/.github/workflows/vsix.yml
index 30e899900..6f13efc7a 100644
--- a/.github/workflows/vsix.yml
+++ b/.github/workflows/vsix.yml
@@ -64,21 +64,21 @@ jobs:
       run: |
         7z x src/GUI/lib/efreveng80.exe.zip -oefreveng80 -y
         dir /a:-d /s /b "efreveng80" | find /c ":\" > filecount.txt
-        findstr "167" filecount.txt
+        findstr "166" filecount.txt
 
     - name: Extract and verify efreveng90.exe.zip file count
       shell: cmd
       run: |
           7z x src/GUI/lib/efreveng90.exe.zip -oefreveng90 -y
           dir /a:-d /s /b "efreveng90" | find /c ":\" > filecount.txt
-          findstr "167" filecount.txt
+          findstr "166" filecount.txt
 
     - name: Extract and verify efreveng100.exe.zip file count
       shell: cmd
       run: |
           7z x src/GUI/lib/efreveng100.exe.zip -oefreveng100 -y
           dir /a:-d /s /b "efreveng100" | find /c ":\" > filecount.txt
-          findstr "143" filecount.txt
+          findstr "141" filecount.txt
 
     - name: Setup MSBuild.exe
       uses: microsoft/setup-msbuild@v3
diff --git a/src/Core/RevEng.Core.100/RevEng.Core.100.csproj b/src/Core/RevEng.Core.100/RevEng.Core.100.csproj
index 0f8b01a46..f1cda8112 100644
--- a/src/Core/RevEng.Core.100/RevEng.Core.100.csproj
+++ b/src/Core/RevEng.Core.100/RevEng.Core.100.csproj
@@ -29,7 +29,7 @@
     <PackageReference Include="Bricelam.EntityFrameworkCore.Pluralizer" Version="1.0.0" />
     <!--<PackageReference Include="EFCore.Snowflake" Version="9.0.4" />-->
     <PackageReference Include="EntityFrameworkCore.Scaffolding.Handlebars" Version="10.0.0-beta1" />
-    <!--<PackageReference Include="EntityFrameworkCore.Sqlite.NodaTime" Version="9.1.0" />-->
+    <PackageReference Include="EntityFrameworkCore.Sqlite.NodaTime" Version="10.0.0" />
     <PackageReference Include="FirebirdSql.EntityFrameworkCore.Firebird" Version="13.0.0" />
     <PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.4" />
     <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.6" />
diff --git a/src/Core/RevEng.Core.80/ServiceProviderBuilder.cs b/src/Core/RevEng.Core.80/ServiceProviderBuilder.cs
index 397ac1aa1..674bc4acd 100644
--- a/src/Core/RevEng.Core.80/ServiceProviderBuilder.cs
+++ b/src/Core/RevEng.Core.80/ServiceProviderBuilder.cs
@@ -171,13 +171,11 @@ public static IServiceCollection AddEfpt(this IServiceCollection serviceCollecti
                     var sqliteProvider = new SqliteDesignTimeServices();
                     sqliteProvider.ConfigureDesignTimeServices(serviceCollection);
 
-#if !CORE100
                     if (options.UseNodaTime)
                     {
                         var nodaTime = new SqliteNodaTimeDesignTimeServices();
                         nodaTime.ConfigureDesignTimeServices(serviceCollection);
                     }
-#endif
                     break;
 
                 default:
@@ -284,4 +282,4 @@ private static void AddSqlServerProviderServices(IServiceCollection serviceColle
 #endif
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/GUI/RevEng.Shared/Providers.cs b/src/GUI/RevEng.Shared/Providers.cs
index 1fae0ce79..4ebbdb1bb 100644
--- a/src/GUI/RevEng.Shared/Providers.cs
+++ b/src/GUI/RevEng.Shared/Providers.cs
@@ -262,6 +262,10 @@ public static List<NuGetPackage> GetNeededPackages(DatabaseType databaseType, bo
                             pkgVersion = "9.1.0";
                             break;
 
+                        case CodeGenerationMode.EFCore10:
+                            pkgVersion = "10.0.0";
+                            break;
+
                         default: throw new NotImplementedException();
                     }
 
@@ -536,4 +540,4 @@ private static Dictionary<string, List<string>> GetProvidersWithAliases()
             };
         }
     }
-}
\ No newline at end of file
+}


Test patch:
diff --git a/src/Core/NUnitTestCore/ProvidersTests.cs b/src/Core/NUnitTestCore/ProvidersTests.cs
new file mode 100644
index 000000000..57bdc7011
--- /dev/null
+++ b/src/Core/NUnitTestCore/ProvidersTests.cs
@@ -0,0 +1,28 @@
+using System.Linq;
+using RevEng.Common;
+using Xunit;
+
+namespace UnitTests
+{
+    public class ProvidersTests
+    {
+        [Fact]
+        public void GetNeededPackagesIncludesSqliteNodaTimeForEfCore10()
+        {
+            var packages = Providers.GetNeededPackages(
+                DatabaseType.SQLite,
+                useSpatial: false,
+                useNodaTime: true,
+                useDateOnlyTimeOnly: false,
+                useHierarchyId: false,
+                discoverMultipleResultSets: false,
+                hasProcedures: false,
+                CodeGenerationMode.EFCore10);
+
+            var nodaTimePackage = packages.Single(p => p.PackageId == "EntityFrameworkCore.Sqlite.NodaTime");
+
+            Assert.Equal("10.0.0", nodaTimePackage.Version);
+            Assert.Equal("NodaTime", nodaTimePackage.UseMethodName);
+        }
+    }
+}