From 6211f65a5e08fe567b774d00dcad75affcf25a98 Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 2 Apr 2026 12:47:11 +0200 Subject: [PATCH] fix(01-08): provide file paths to ProfileRepository and SettingsRepository via factory registration --- SharepointToolbox/App.xaml.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SharepointToolbox/App.xaml.cs b/SharepointToolbox/App.xaml.cs index fed3a2f..69731a6 100644 --- a/SharepointToolbox/App.xaml.cs +++ b/SharepointToolbox/App.xaml.cs @@ -70,8 +70,11 @@ public partial class App : Application private static void RegisterServices(HostBuilderContext ctx, IServiceCollection services) { - services.AddSingleton(); - services.AddSingleton(); + var appData = Path.Combine( + Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), + "SharepointToolbox"); + services.AddSingleton(_ => new ProfileRepository(Path.Combine(appData, "profiles.json"))); + services.AddSingleton(_ => new SettingsRepository(Path.Combine(appData, "settings.json"))); services.AddSingleton(); services.AddSingleton(); services.AddSingleton();