In his step by step tutorial, we would use Entity Framework to create an MVC application. This application would maintain a list of item.
We would be able select, insert, update and delete data in the database.
Step 1 – Create your database using MS SQL Server. Also create a table.
Step 2 – Create a new Solution using Visual Studio and select the following:
- ASP.Net Core Web Application
- Web Application (Model-View-Controller)
Once the application starts up, we’ll have to add Entity Framework to our solution
Step 3 – Right-click on the solution and choose Manage Nugget Packages. Then in the windows that appears, search for Entity Framework and select Microsoft.EntityFrameworkCore. Install it to the solution.
Now we need to add Entity Data Model to our solution. This would be used to create a connection to the database and do Object Relational Mapping(ORM)
Step 4 – Right-click on your solution and Choose Add New. Select Data and then