Beispiel #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            var connectionFactory  = new ConnectionFactory();
            var customerRepository = new CustomerRepository(connectionFactory);
            var cityRepository     = new CityRepository(connectionFactory);
            var accountRepository  = new AccountRepository(connectionFactory);
            var dialogService      = new WindowDialogService(accountRepository);

            var customersWindow = new CustomersWindow(customerRepository, cityRepository, dialogService);

            customersWindow.Show();
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            var context = new BankContext();

            context.CreateOrUpdateDatabase();

            var customerRepository = new CustomerRepository(context);
            var cityRepository     = new CityRepository(context);
            var accountRepository  = new AccountRepository(context);

            var customerValidator = new CustomerValidator(cityRepository);
            var accountValidator  = new AccountValidator(customerRepository);

            var dialogService = new WindowDialogService(accountRepository, accountValidator);

            var customersWindow = new CustomersWindow(customerRepository, customerValidator, cityRepository, dialogService);

            customersWindow.Show();
        }