Projekte können erstellt und geladen werden
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SewerStammGen.EntityFramework;
|
||||
using SewerStammGen.HostBuilders;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using System;
|
||||
@@ -40,6 +42,12 @@ namespace SewerStammGen.WPF
|
||||
|
||||
_host.Start();
|
||||
|
||||
SewerStammGenDbContextFactory contextFactory = _host.Services.GetRequiredService<SewerStammGenDbContextFactory>();
|
||||
using(SewerStammGenDbContext context = contextFactory.CreateDbContext())
|
||||
{
|
||||
context.Database.Migrate();
|
||||
}
|
||||
|
||||
MainWindow? window = new MainWindow() { DataContext = _host.Services.GetRequiredService<MainWindowViewModel>() };
|
||||
window.Show();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user