[Failed] Try to implement NativeAOT support.

Add: NativeAOT support with EF Core. However failed for compiled binary throw Exception in queries. Wait for a stable support for NativeAOT.

Add: document for intergration EF Core with NativeAOT.
This commit is contained in:
2025-07-11 16:07:14 +08:00
parent 8b18de1735
commit eb021576a5
9 changed files with 498 additions and 2 deletions

View File

@ -1,5 +1,6 @@
using Microsoft.EntityFrameworkCore;
using OptixServe.Infrastructure.Configuration;
using OptixServe.Infrastructure.Data.CompiledModels;
namespace OptixServe.Infrastructure.Utilites;
@ -22,7 +23,8 @@ public static class DatabaseHelper
var dbPath = dbSettings.Host ?? "optixserve.db";
var connectionString = $"Data Source={dbPath}";
options.UseSqlite(connectionString, b => b.MigrationsAssembly("OptixServe.Infrastructure"));
options.UseSqlite(connectionString, b => b.MigrationsAssembly("OptixServe.Infrastructure"))
.UseModel(AppDbContextModel.Instance);
}
else