As part of my return to C#, I decided to review EntityFramework Core, the Object Relational Mapper (ORM) that makes it so much easier to pass data between your database and a .NET program. After wading through documentation, trying to put the basics together, I decided to do a short video on it as part of the demo.
The full code is also available on Github for download.
For this demo, I used the Northwind SQLite database to create a Windows forms project that would display the Products table in a bound grid with a couple of extra controls, allow changes and then save them when requested.
The full project in the Github repository shows how to bind the data to a data grid, a combo box and a text box. It also demonstrates how to add custom properties to the partial model classes that EF creates based on the database tables to display concatented or calculated information.
EntityFramework Core is definitely an improvement over basic ADO.NET and saves a lot of time and effort over manually managing connections and datasets. The models I was able to automatically generate from the existing database provide class properties that can be easily referenced in code. It also recognizes the relationships between the tables and makes it easier to reference information based on foreign keys.
There’s a bit of a learning curve involved but it’s definitely worth it to be able to quickly create data apps in Visual Studio.
Also, if you’d like to know more about working with SQLite, check out my book Self-Guided SQL: Build Your SQL Skills with SQLite, available on Amazon.com!
Sign up for my newsletter to receive updates about new projects, including my new book "Self-Guided SQL: Build Your SQL Skils with SQLite"!
We respect your privacy and will never share your information with third-parties. See our privacy policy for more information.

