From 30d336163de24d6f496a93a398d2c014ce1a6e3a Mon Sep 17 00:00:00 2001 From: Giorgio Lasala Date: Sun, 10 Oct 2021 04:03:58 +0200 Subject: [PATCH] dotnet-ef: add page (#6799) --- pages/common/dotnet-ef.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 pages/common/dotnet-ef.md diff --git a/pages/common/dotnet-ef.md b/pages/common/dotnet-ef.md new file mode 100644 index 000000000..1bd6b1751 --- /dev/null +++ b/pages/common/dotnet-ef.md @@ -0,0 +1,36 @@ +# dotnet ef + +> Perform design-time development tasks for Entity Framework Core. +> More information: . + +- Update the database to a specified migration: + +`dotnet ef database update {{migration}}` + +- Drop the database: + +`dotnet ef database drop` + +- List available `DbContext` types: + +`dotnet ef dbcontext list` + +- Generate code for a `DbContext` and entity types for a database: + +`dotnet ef dbcontext scaffold {{connection_string}} {{provider}}` + +- Add a new migration: + +`dotnet ef migrations add {{name}}` + +- Remove the last migration, rolling back the code changes that were done for the latest migration: + +`dotnet ef migrations remove` + +- List available migrations: + +`dotnet ef migrations list` + +- Generate a SQL script from migrations range: + +`dotnet ef migrations script {{from_migration}} {{to_migration}}`