Entity Framework and EF Core
Visual interface for EF Core commands
In Entity Framework Core projects, JetBrains Rider helps execute dotnet EF Core commands using a visual interface. Each command has a dedicated dialog that autofills most arguments, provides fields for all arguments that are allowed, and ensures that all required arguments are specified.
Execute EF Core commands
Select
from the main menu.Right-click the desired project in the Solution Explorer and choose
.
Troubleshooting
Project does not appear in the 'Startup projects' field
Check that the desired project satisfies the following requirements:
Microsoft.EntityFrameworkCore.Design
orMicrosoft.EntityFrameworkCore.Tools
NuGet package is installed.Project's target framework is at least
netcoreapp3.1.
dotnet ef
tools installed globally are not working from the terminal
If you see the following message:
Make sure that .dotnet/tools folder is included in the PATH
environment variable. For more information, see this troubleshooting guide.
On Windows, you can also run the .NET SDK installer with the 'Repair' option.
Code inspections
JetBrains Rider provides the following code inspections for code issues specific to Entity Framework projects:
If you do not find some or all of these inspections helpful, you can clear the Enable Entity Framework-specific inspections checkbox on the page of JetBrains Rider settings Ctrl+Alt+S, or alternatively, you can disable only model-specific or only query-specific inspections on that page.
On that settings page, you can also list FQNs (fully qualified names) of database context classes (classes inherited from DbContext
) that will be ignored during code analysis for identifying N+1, incomplete data, and other related issues.
You can click Add above the table to specify FQNs manually, or you can press Alt+Enter in the editor at the corresponding highlighting and choose to ignore the related context class: