InkForge/app/InkForge.Common/Microsoft/Extensions/DependencyInjection/InkForgeServiceCollection.cs
2024-02-10 23:47:45 +01:00

29 lines
749 B
C#

using InkForge.Common.Controllers;
using InkForge.Common.Data;
using InkForge.Common.ViewModels;
using InkForge.Common.ViewModels.Landing;
using InkForge.Data;
using ReactiveUI;
using Splat;
namespace Microsoft.Extensions.DependencyInjection;
public static class InkForgeServiceCollections
{
public static IServiceCollection AddInkForge(this IServiceCollection services)
{
services.AddHttpClient();
services.AddDbContextFactory<NoteDbContext, NoteDbContextFactory>();
services.AddSingleton<LandingViewModel>();
services.AddSingleton<LandingViewModelFactory>();
services.AddSingleton<WorkspaceController>();
Locator.CurrentMutable.RegisterViewsForViewModels(typeof(InkForgeServiceCollections).Assembly);
return services;
}
}