@
R3 Slice 1: EF-Core-Infrastruktur im Core + InitialCore-Migration - Pomelo.EntityFrameworkCore.MySql 8.0.3 + EF Core Design 8.0.11 (Core), NuGet-Allowlist erweitert - Configuration/DatabaseOptions + DatabaseServerVersion (MariaDB 11.8.6 gepinnt) - Persistence/Entities: CorePosition, CoreTrade, CoreBudget, CoreWorkerLog, CoreSetting - Persistence/Ef/CoreDbContext (core_-Tabellen) + Design-Time-Factory (env IBKRTRADER_MYSQL) - DependencyInjection/AddCorePersistence (AddDbContextFactory), in Program verdrahtet (Connection aus appsettings.Local.json) - EF-Migration InitialCore erzeugt (5 core_-Tabellen) - Consumer noch auf Dapper (folgt in Slice 2); Build + 30/30 Tests + smoke-ui gruen Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> @
This commit is contained in:
+11
-3
@@ -1,7 +1,9 @@
|
||||
using IBKRTrader.Core.AI;
|
||||
using IBKRTrader.Core.Budget;
|
||||
using IBKRTrader.Core.Configuration;
|
||||
using IBKRTrader.Core.Database;
|
||||
using IBKRTrader.Core.Database.Migrations;
|
||||
using IBKRTrader.Core.DependencyInjection;
|
||||
using IBKRTrader.Core.IBKR;
|
||||
using IBKRTrader.Core.Logging;
|
||||
using IBKRTrader.Core.Modularity;
|
||||
@@ -49,7 +51,7 @@ internal static class Program
|
||||
config.AddJsonFile("appsettings.Local.json", optional: true, reloadOnChange: false))
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
RegisterCoreServices(services);
|
||||
RegisterCoreServices(services, context.Configuration);
|
||||
foreach (var module in modules)
|
||||
{
|
||||
services.AddSingleton(module);
|
||||
@@ -77,8 +79,14 @@ internal static class Program
|
||||
}
|
||||
|
||||
/// <summary>Registriert alle Core-Services im DI-Container.</summary>
|
||||
private static void RegisterCoreServices(IServiceCollection services)
|
||||
private static void RegisterCoreServices(IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
// EF-Core-Persistenz (Connection aus appsettings.Local.json).
|
||||
services.AddCorePersistence(new DatabaseOptions
|
||||
{
|
||||
MySqlConnectionString = configuration["Database:MySqlConnectionString"] ?? string.Empty
|
||||
});
|
||||
|
||||
// Settings zuerst laden (eine Quelle, als Singleton weitergereicht).
|
||||
var settingsService = new SettingsService();
|
||||
settingsService.Load();
|
||||
@@ -194,7 +202,7 @@ internal static class Program
|
||||
config.AddJsonFile("appsettings.Local.json", optional: true, reloadOnChange: false))
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
RegisterCoreServices(services);
|
||||
RegisterCoreServices(services, context.Configuration);
|
||||
foreach (var module in modules)
|
||||
{
|
||||
services.AddSingleton(module);
|
||||
|
||||
Reference in New Issue
Block a user