Finished Settings page

This commit is contained in:
2025-11-12 17:06:14 +01:00
parent a608f98497
commit e0bf95060a
38 changed files with 675 additions and 34 deletions

View File

@@ -0,0 +1,16 @@
using Microsoft.Extensions.DependencyInjection;
using WorkTime.Database.Repositories;
using WorkTime.Models.Repositories;
namespace WorkTime.Database;
public static class ServiceCollectionExtensions {
public static void AddDatabase(this IServiceCollection services, string basePath) {
services.AddSqlite<DatabaseContext>($"Filename={Path.Combine(basePath, "data.db")}");
services.AddHostedService<DbMigrationService>();
services.AddTransient<ITimeEntryRepository, TimeEntryRepository>();
services.AddTransient<ISettingsRepository, SettingsRepository>(_ => new SettingsRepository(Path.Combine(basePath, "settings.json")));
}
}