ASP.NET Core - Scaffolding with Entity Framework Core (Database first approach)

preview_player
Показать описание
In this video, you will learn how to generate your class models using your existing database tables.

Steps followed:
--------------------------
1- Connecting to the existing database.
2-Adding the Connection String to the AppSettings.JSON file.
3- Installing the necessary packages.
4- Using the Scaffold command to generate the models.

The Scaffold Command:
-----------------------------------------
Scaffold-DbContext {-Connection-string-in-quotations-} Microsoft.EntityFrameWorkCore.SqlServer -outputdir Repository/Models -context {-databasename-}DbContext -contextdir Repository -DataAnnotations -Force

Рекомендации по теме
Комментарии
Автор

ty explained it STRAIGHT instead of doing 25min video

lashuti
Автор

Excelent guidance.. helped me a lot. Many thanks!

newsflow
Автор

we can also do without writing command right ?

fahadaslamtanoli
Автор

even if i add a new column, i can just scaffold and thats it right ?

ahmedifhaam
Автор

Why there is no 'Object Explorer' in my visual studio code 2019? I am using the community version

yuecheng
Автор

Instead of tables can we do scaffolding for Views as well?

arjkap
Автор

This is useless metho, what If we publish this in Azure or any other host how can we update that connection string that is hardcoded inside C# Code ?

doctorit