filmov
tv
How to use Entity Framework Core in ASP.NET Core 6.0 | Database First Approach

Показать описание
Generate database models in separate class library core projects and use them in ASP.NET Core
To use Entity Framework Core with ASP.NET Core 6.0 MVC in the database-first approach, you can follow the following steps:
Install the necessary NuGet packages:
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
You can do this through the Package Manager Console or the NuGet Package Manager UI.
CMD
================================================
Scaffold-DbContext "Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog=TokenGenerationSystem;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir EntityModels
To use Entity Framework Core with ASP.NET Core 6.0 MVC in the database-first approach, you can follow the following steps:
Install the necessary NuGet packages:
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
You can do this through the Package Manager Console or the NuGet Package Manager UI.
CMD
================================================
Scaffold-DbContext "Data Source=(LocalDB)\MSSQLLocalDB;Initial Catalog=TokenGenerationSystem;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir EntityModels