I want to create an ASP.NET Core MVC application. It seemed it was no good idea to use a .NET Framework project, since the abandon of Entity Framework 6.
So, I try .NET Core, and I read this: Entity Framework Core (EF Core) Database First Approach - Dot Net Tutorials
I installed Microsoft.EntityFrameworkCore.Design, and now I type
Scaffold-DbContext "Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True;Encrypt=True;Trust Server Certificate=True"
In the Nuget Package console, I am answered that Scaffold-DbContext is not a recognized applet command name, script, command ...
If, just in case, I try the same in the "Immediate" window, I am answered that Data is not a valid format specifier (CS0726).
In the "Add, New Element" contextual menu entry, I have no "Entity Data Model Wizard".
Do you see what I missed ?
I'm using
- Visual Studio 2022 Community
- Windows 11
- SQL Server 2014 Express
For Asp.net-core project to use
Scaffold-DbContextYou need to install following packages:And the ASP.NET Core doesn't support "ADO.Net Entity Data Model Wizard". It can only be used in old .NET framework project.
I suggest you try this sample https://medium.com/@certosinolab/exploring-database-first-approach-with-entity-framework-in-net-core-6-db86a822d72e