protected override void OnStartup(StartupEventArgs e) { var connectionFactory = new ConnectionFactory(); var lotteryGameRepository = new LotteryGameRepository(connectionFactory); var drawRepository = new DrawRepository(connectionFactory); var drawService = new DrawService(drawRepository); var lotteryWindow = new LotteryWindow(lotteryGameRepository, drawRepository, drawService); lotteryWindow.Show(); }
protected override void OnStartup(StartupEventArgs e) { var context = new LotteryContext(); context.CreateOrUpdateDatabase(); var lotteryGameRepository = new LotteryGameRepository(context); var drawRepository = new DrawRepository(context); var drawService = new DrawService(drawRepository); var lotteryWindow = new LotteryWindow(lotteryGameRepository, drawRepository, drawService); lotteryWindow.Show(); }