ExtensionMethods and finetuning
This commit is contained in:
@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user