@
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:
@@ -0,0 +1,25 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace IBKRTrader.Core.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Datenbank-Konfiguration, gebunden an die "Database"-Sektion in appsettings(.Local).json.
|
||||
/// </summary>
|
||||
public class DatabaseOptions
|
||||
{
|
||||
public const string SectionName = "Database";
|
||||
|
||||
/// <summary>MySQL/MariaDB-Connection-String (aus gitignorierter appsettings.Local.json).</summary>
|
||||
public string MySqlConnectionString { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Fest gepinnte Ziel-Server-Version (MariaDB 11.8.6, via <c>--db-version</c> bestätigt). Bewusst
|
||||
/// gepinnt statt <c>ServerVersion.AutoDetect</c>: AutoDetect öffnet beim Bau der DbContext-Optionen
|
||||
/// eine blockierende DB-Verbindung – ist die DB langsam/nicht erreichbar, hängt der Start. Mit fester
|
||||
/// Version startet die App unabhängig von der DB, und Migrations-Scaffolding läuft ohne DB-Verbindung.
|
||||
/// </summary>
|
||||
public static class DatabaseServerVersion
|
||||
{
|
||||
public static ServerVersion Value => new MariaDbServerVersion(new Version(11, 8, 6));
|
||||
}
|
||||
Reference in New Issue
Block a user