Migrating a Windows Forms application
Before we get started, let's take a brief inventory of the Windows Forms application. The data access layer is provided by the DBContext
class of EF6.
Note
EF is a modern object-database mapper (ORM) for .NET, which simplifies working with databases. Thanks to EF, you can map all the database concepts (such as tables, rows, and columns) to the equivalent C# concepts (such as classes, properties, and collections). We won't cover EF in detail, since it's beyond the scope of this book. You can learn more at https://docs.microsoft.com/en-us/ef/.
To keep the sample focused and concise, we are not using additional patterns to decouple the context. The main window hosts two tabs, one containing the Overview view and the other with the detailed Item view:
The Overview tab displays a DataGrid
control, which is used for displaying and...