Phase 3b: Repository-Schicht im Core (Interfaces + Mongo-Impl + DI)
- Interfaces: IAccountRepository, IMarketRepository, IPositionRepository (IPositionRepository kapselt das Collection-per-Account-Muster). - Mongo-Implementierungen bilden die bisherige Shim-Semantik 1:1 mit direkten MongoDB.Driver-Aufrufen nach (kein App-Shim-Bezug im Core). - AddCorePersistence()-Erweiterung + Registrierung in Program.cs. - Noch keine Call-Sites umgestellt; Build 0 Fehler. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Options;
|
||||
using PolyTrader.Core.Configuration;
|
||||
using PolyTrader.Core.DependencyInjection;
|
||||
using PolyTraderSharp.Models;
|
||||
using PolyTraderSharp.Services;
|
||||
|
||||
@@ -33,6 +34,7 @@ internal static class Program
|
||||
var client = new MongoClient(dbOptions.ConnectionString);
|
||||
return client.GetDatabase(dbOptions.DatabaseName);
|
||||
});
|
||||
services.AddCorePersistence();
|
||||
services.AddSingleton((IServiceProvider sp) => ServerSettings.Load("server_settings.xml"));
|
||||
services.AddSingleton<TradingState>();
|
||||
services.AddSingleton(copySignalChannel.Writer);
|
||||
|
||||
Reference in New Issue
Block a user