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;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace DaSaSo.Wpf
{
///
/// Interaction logic for App.xaml
///
public partial class App : Application
{
protected override async void OnStartup(StartupEventArgs e)
{
IServiceProvider serviceProvider = CreateServiceProvider();
IDataService clientService = new ClientDataService(new DaSaSoDbContextFactory());
var d = await clientService.GetAll();
base.OnStartup(e);
MainWindow? window = new MainWindow() { DataContext = new MainWindowViewModel() };
window.Show();
}
private IServiceProvider CreateServiceProvider()
{
IServiceCollection services = new ServiceCollection();
services.AddSingleton();
//services.AddSingleton, ClientDataService>();
return services.BuildServiceProvider();
}
}
}