- Create a .NET Core console application
- Create a model type, e.g. the class
Book - Add properties to the model type, e.g. BookId, Title, and Publisher
- Create a BooksContext class that derives from DbContext
- Add the necessary NuGet packages
- Define a property to access the Book type using DbSet
- Instantiate the context in the
Mainmethod - Add new objects
- Save changes
- Override the configuring method of the context
- Configure to use SQL Server
- Add the necessary NuGet package
- Create a database on starting the application
- Configure the dotnet ef tool in csproj.
- Enable migrations with the project
- Change the model type by adding an additional property
- Define code migrations for the update
- Run migrations from code and using the dotnet tool
- Create an EF context for the entity type you created earlier
- Define the constructor needed with EF using dependency injection
- Configure the context in the dependency injection container
- Create the database programmatically
- Create a new controller to write a new record to the database