ExtensionMethods and finetuning

This commit is contained in:
2022-08-24 09:24:44 +02:00
parent 595e9e2365
commit 7806f2e85d
6 changed files with 38 additions and 12 deletions

View File

@ -16,6 +16,7 @@ using YouTubeViewers.EntityFramework.Commands;
using YouTubeViewers.EntityFramework.Queries;
using YouTubeViewers.WPF.Stores;
using YouTubeViewers.WPF.ViewModels;
using YouTubeViewers.WPF.HostBuilders;
namespace YouTubeViewers.WPF;
@ -27,15 +28,9 @@ public partial class App : Application
public App()
{
_host = Host.CreateDefaultBuilder()
.AddDbContext()
.ConfigureServices((context, services) =>
{
string connectionString = context.Configuration.GetConnectionString("sqlite");
services.AddSingleton<DbContextOptions>(
new DbContextOptionsBuilder()
.UseSqlite(connectionString)
.Options);
services.AddSingleton<YouTubeViewersDbContextFactory>();
services.AddSingleton<IGetAllYouTubeViewersQuery,GetAllYouTubeViewersQuery>();
services.AddSingleton<ICreateYouTubeViewerCommand,CreateYouTubeViewerCommand>();
services.AddSingleton<IUpdateYouTubeViewerCommand,UpdateYouTubeViewerCommand>();