Essential Docker for ASP.NET Core MVC by Adam Freeman

Essential Docker for ASP.NET Core MVC by Adam Freeman

Author:Adam Freeman
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


Creating the Database Migration

The next step is to create the initial Entity Framework Core migration that will define the schema for the application. This uses the EF Core Code First feature, which generates database schemas automatically from the data model classes in an ASP.NET Core application. Run the command shown in Listing 5-24 from the ExampleApp folder to create the migration.

dotnet ef migrations add Initial

Listing 5-24.Creating the Initial Database Migration

If you are using Visual Studio, you can open the Package Manager Console (available in the Tools ➤ NuGet Package Manager menu) and run the PowerShell command shown in Listing 5-25 instead.

Add-Migration Initial

Listing 5-25.Creating the Database Migrations Using the Visual Studio Package Manager Console



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.