Step by step: .NET Core and Entity Framework Core

Today I’ll show you how to create a small console application with a Step by step: .NET Core and Entity Framework Core example.

First be aware of the following prerequisites:

OS Prerequisites
Windows Windows: You must have .NET Core SDK for Windows or both Visual Studio 2015 Update 3* and .NET Core 1.0 for Visual Studio installed.
linux, mac or docker checkout .NET Core

Now let’s start:

1. Create a folder for your new project
2. Create the project
3. Create a settings file
4. Modify the project file
5. Restore packages
6. Create the Entity Framework context
7. Modify Program.cs
8. Build
9. Run

You can get the code here:

Hope it helps!

8 thoughts on “Step by step: .NET Core and Entity Framework Core

  1. Esta muy bueno, gracias.
    You could do a quick edit to note that you also need
    using Microsoft.Extensions.Configuration;
    in program.cs and to wrap the program.cs in the ConsoleApplication namespace.

    It didn’t take _me_ long to work it out but I remember when I was just starting out these omissions killed me. And for beginners it’s so much more educational to type (or copy) the code rather than just downloading the finished product from GitHub.

    Thanks again,

Leave a Reply