The first step:
Step Two:
Step Three:
Fourth step: Enter commands in the console
(1)install-package microsoft.entityframeworkcore
(2)install-package Microsoft.EntityFrameworkCore.SqlServer
(3)install-package Microsoft.EntityFrameworkCore.Tools
(4)install-package Microsoft.EntityFrameworkCore.SqlServer.Design
Fifth Step:
Create a models folder in your project project also use the command to generate the EF context from the database
Scaffold-dbcontext "Data Source=ip (general use); Initial catalog= database name; User id= login name; password= login Password "Microsoft.entityframeworkcore.sqlserver-outputdir Models
Sixth step: Need to refer to using Microsoft.entityframeworkcore;
And then the top
Seventh Step: Controller
Eighth Step: View (all the views in ASP. are now created manually instead of clicking the mouse button as previously MVC) it's no different from the original MVC form.
Create the first ASP. NET core program to connect to a database using Dbfirst mode