40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using DaSaSo.Domain.Model;
|
|
using DaSaSo.Domain.Services;
|
|
using DaSaSo.EntityFramework;
|
|
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
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for App.xaml
|
|
/// </summary>
|
|
public partial class App : Application
|
|
{
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
IServiceProvider serviceProvider = CreateServiceProvider();
|
|
base.OnStartup(e);
|
|
MainWindow? window = new MainWindow() { DataContext = new MainWindowViewModel() };
|
|
window.Show();
|
|
}
|
|
|
|
private IServiceProvider CreateServiceProvider()
|
|
{
|
|
IServiceCollection services = new ServiceCollection();
|
|
|
|
services.AddSingleton<DaSaSoDbContext>();
|
|
services.AddSingleton<IDataService<Client>, ClientDataService>():
|
|
|
|
return services.BuildServiceProvider();
|
|
}
|
|
}
|
|
}
|