Setting Up the Dotnet-Ef Tool

Learn about configuring the dotnet-ef tool for EF Core, a .NET CLI tool used for performing design-time tasks.

Let’s see a tool to do some of the work for us. The .NET CLI tool named dotnet can be extended with capabilities useful for working with EF Core. It can perform design-time tasks like creating and applying migrations from an older model to a newer model and generating code for a model from an existing database.

Configuring the dotnet-ef tool for EF Core

The dotnet ef command-line tool is not automatically installed. We must install this package as either a global or local tool. If we have already installed an older version of the tool, then we should uninstall any existing version:

Step 1: At a command prompt or terminal, check if we have already installed dotnet-ef as a global tool, as shown in the following command:

Get hands-on with 1400+ tech skills courses.