Installation of Entity Framework Core
Entity Framework Core is not a part of .NET Core. It is available as a Nuget Package that can be added to your project in many ways based on your development environment and the available tools.
Ensure that you have Visual Studio 2019 and SQL server 2019 in your system before proceeding to the tutorial's next steps. Follow the steps below to install Entity Framework Core in a Razor Page application.1. Open Visual Studio -> Create New Project->ASP.NET core web application->Next->
2. Name the project As “MyEFCoreApp” and Click Next
3. Make sure that .NET Core and ASP.NET 5.0 are selected in the dropdown list, Select ASP.NET.Core web App, and Click Create
4. Once the solution is ready Go to Tools -> NuGet Package Manager -> Manage NuGet Packages For Solution
5. Select Browse tab and type "entityframeworkcore.sqlserver" into the search box and select Microsoft.EntityFrameworkCore. SqlServer when it appears and select your project name "MyEFCoreApp" and Click install
6. When the License Acceptance window appears Click "I Accept" button
7. Next, search for "entityframeworkcore.tools" and install "Microsoft.EntityFrameworkCore.Tools" as you installed the previous package
Now you have installed the two essential packages that are required to use Entity Framework Core in your application.
You are ready to go to the next step of the tutorial. There, we will add DBContext to the application and use it to connect to the database server and create a new database and a table.