InkForge/app/InkForge.Desktop/Microsoft/Extensions/DependencyInjection/InkForgeServiceCollection.cs

35 lines
878 B
C#
Raw Normal View History

using InkForge.Data;
2024-02-16 02:23:58 +01:00
using InkForge.Desktop.Data;
using InkForge.Desktop.Data.Options;
using InkForge.Desktop.Managers;
using InkForge.Desktop.Models;
2024-02-16 02:23:58 +01:00
using InkForge.Desktop.ViewModels;
2024-02-09 01:23:38 +01:00
2024-02-16 02:23:58 +01:00
using Microsoft.EntityFrameworkCore;
2024-02-09 13:02:20 +01:00
using ReactiveUI;
2024-02-10 23:47:45 +01:00
using Splat;
2024-02-09 01:23:38 +01:00
namespace Microsoft.Extensions.DependencyInjection;
public static class InkForgeServiceCollections
{
public static IServiceCollection AddInkForge(this IServiceCollection services)
{
services.AddHttpClient();
services.AddScoped<IWorkspaceAccessor, WorkspaceAccessor>();
2024-02-16 02:23:58 +01:00
services.AddScoped<IDbContextFactory<NoteDbContext>, NoteDbContextFactory>();
services.AddScoped<LocalWorkspaceOptions>();
2024-02-09 01:23:38 +01:00
2024-02-10 10:38:28 +01:00
services.AddSingleton<LandingViewModel>();
services.AddSingleton<WorkspaceManager>();
2024-02-09 01:23:38 +01:00
2024-02-10 23:47:45 +01:00
Locator.CurrentMutable.RegisterViewsForViewModels(typeof(InkForgeServiceCollections).Assembly);
2024-02-09 13:02:20 +01:00
2024-02-09 01:23:38 +01:00
return services;
}
}