Note: It is also possible to enter the value “0” in this field to reset the state of the database before the first migration. The list of migrations is sorted, which shows their order depending on the creation date. Feel free to use autocompletion suggestions in this field to find the necessary migration faster. The Target migration field is responsible for the target migration. Use Tools | Entity Framework Core | Update Database to update the database to the required target migration: You can try to execute the command again by clicking the Try again button: If an error occurs during the execution of the command, it will be displayed in the notification and in the Event log. Although this option reduces the execution time of the command, it is also a source of potential problems.Īfter you click OK, the corresponding dotnet ef migrations add command will be executed in the background: Skipping the build process ( -no-build) is not recommended unless your project specifically needs to skip it. The DbContext field only displays the available migrations in the selected Migrations project. If this is the first migration in this project, the migration name will be “Initial”. In most cases all you’ll need to do is select the correct Migrations project, Startup project, and DbContext class. When you need to create a new migration, you can use the Tools | Entity Framework Core | Add Migration dialog:īuild options contain the default values. When executing any command through the dialog box, the current pair of projects will be saved to make it easier to execute commands on these projects in the future. Note that the dialog boxes are adjusted to the current version of dotnet ef, so not all options may be available for your environment.īoth the Migrations project and the Startup project can be used to access the dialog boxes. Note that projects with a target framework below netcoreapp3.1 and netstandard2.1 are not currently supported.Īll dialog boxes are available in the context menu of the project in the Solution Explorer tool window, under Tools | Entity Framework Core: When you click Fix, the necessary tools will be installed in the background.įor supported projects to appear in dialog boxes, one of the following NuGet packages must be installed in the startup project: If dotnet ef has not yet been installed, you will be prompted to install it when you open an Entity Framework Core–enabled project: To do this, go to Settings | Plugins | Marketplace and search for “Entity Framework Core”:Īfter the plugin is installed, restart Rider: Preparing the projectįor the plugin to work, a supported version of the global dotnet ef tool (3.1 or later) must be installed. The easiest way to install this plugin is directly from the IDE. This article touches on the new plugin, Entity Framework Core UI for JetBrains Rider, which allows you to execute most dotnet ef commands in a more user-friendly way. However, most commands are called quite often during development, and the lack of a convenient user interface can slow down your development process as a whole. They allow you to perform a full range of tasks, from creating migrations and updating the database to generating SQL scripts from the migration code and creating executable bundles from them. To work with Entity Framework Core, it is usually a good idea to use its powerful command-line tools – dotnet ef. In this guest blog post, author Andrew Rublyov demonstrates the powerful features behind the Entity Framework Core UI plugin for Rider. In just a few clicks you’ll have produced the necessary EF Core boilerplate code that’s necessary for database operations. Do you work with Entity Framework Core? Would you like to manage entities right inside your IDE? Then you’re in luck! The Entity Framework Core UI plugin for Rider helps you effectively manage everything you need in EF Core.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |