Benutzer-Werkzeuge

Webseiten-Werkzeuge


html_php_u._javascript:asp.net_core_entityframework_scaffold_database-model

ASP.NET CORE EntityFramework Scaffold Database-Model

https://www.entityframeworktutorial.net/efcore/create-model-for-existing-database-in-ef-core.aspx

DotNet CLI
If you use dotnet command line interface to execute EF Core commands then open command prompt and navigate to the root folder and execute the following dotnet ef dbcontext scaffold command:
dotnet ef dbcontext scaffold "Server=.\SQLEXPRESS;Database=SchoolDB;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -o Models
Thus, you can create EF Core model for an existing database.
Note: Once you have created the model, you must use the Migration commands whenever you change the model to keep the database up to date with the model.
html_php_u._javascript/asp.net_core_entityframework_scaffold_database-model.txt · Zuletzt geändert: 2023/08/21 11:53 von ronny

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki