Entity Framework and EF Core
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.
Select Tools | Entity Framework Core | [command name] from the main menu.
Right-click the desired project in the Solution Explorer and choose Entity Framework Core | [command name].
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.
If you see the following message:
Could not execute because the specified command or file was not found.
Possible reasons for this include:
* You misspelled a built-in dotnet command.
* You intended to execute a .NET program, but dotnet-xyz does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
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.
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 Editor | Inspection Settings | Entity Framework page of JetBrains Rider settings CtrlAlt0S, 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 AltEnter in the editor at the corresponding highlighting and choose to ignore the related context class:
