Client Service hinzugefügt
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using DaSaSo.Domain.Model;
|
||||
using DaSaSo.Domain.Services;
|
||||
using DaSaSo.Domain.Services.ClientServices;
|
||||
using DaSaSo.EntityFramework;
|
||||
using DaSaSo.EntityFramework.Services;
|
||||
using DaSaSo.ViewModel;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
@@ -18,9 +20,11 @@ namespace DaSaSo.Wpf
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
protected override async void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
IServiceProvider serviceProvider = CreateServiceProvider();
|
||||
IDataService<Client> clientService = new ClientDataService(new DaSaSoDbContextFactory());
|
||||
var d = await clientService.GetAll();
|
||||
base.OnStartup(e);
|
||||
MainWindow? window = new MainWindow() { DataContext = new MainWindowViewModel() };
|
||||
window.Show();
|
||||
@@ -31,7 +35,7 @@ namespace DaSaSo.Wpf
|
||||
IServiceCollection services = new ServiceCollection();
|
||||
|
||||
services.AddSingleton<DaSaSoDbContext>();
|
||||
services.AddSingleton<IDataService<Client>, ClientDataService>():
|
||||
//services.AddSingleton<IDataService<Client>, ClientDataService>();
|
||||
|
||||
return services.BuildServiceProvider();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user