Skip to content

Configuring WPF → SQL Server

Aaron Hanusa edited this page Jan 24, 2016 · 5 revisions

WPF → SQL Server

WPF → SQL Server

Watch the configuration video here.

In this scenario, the WPF client consumes business services that are injected with data proxies that use Entity Framework 6.0 to communicate with a SQL Server database.

To configure the WPF application to use business services injected with EF6 data proxies, locate the MainWindow_Loaded event handler in the MainWindow class and ensure the following line exists:

void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
    ConfigureEFUsage();
}

The ConfigureEFUsage method instantiates the business services and passes concrete EF6 data proxies to them for data access.

Before running the application, be sure to setup SQL Server after changing the configuration.

To run the application, ensure that the WPF project is set as the startup project.