Building MVC pattern project by Visual Studio 2017 ( ASP.Net framework Part )
Step 11. Create the Infrastructure project of the onion architecture, which name sets “Enterprise_MVC_WebApplication.Infra.” The infrastructure project performs operations related to outside the applications, including the database operation, accessing outside service, and the access file system.

Step 12. Create a ADO.NET Entity Data Model file which name is “DemoDB_Entities.” Right-click on the Enterprise_MVC_WebApplication.Infra project -> Add -> New item.

Create a ADO.NET Entity Data Model file which name is “DemoDB_Entities.”

If your class library is based on the .Net framework and the .Net Core framework, you can use the entity framework 6.X. You only must add the core project to the infra project reference. If your .Net standard version is 2.0, please install a few of the NuGet package by NuGet package manager in Visual Studio 2017. If your .Net standard version is 2.1, you don’t need to install these NuGet packages because the .Net standard of the 2.1 version has the entity framework 6(EF 6). Remember that the infra project must add the core project to the reference part of the infra project.
- Microsoft.EntityFrameworkCore v3.1
- Microsoft.EntityFrameworkCore.Sqlserver v3.1
- Microsoft.Configuration.Json v2.2
Note: If you use the class library of the .Net Standard 2.0, you must use the dbContext method of the ASP.Net Core framework.
Step 13. Create the Repository file in Enterprise_MVC_WebApplication.Infra project. Write the function about Add, FindByID, Remove…etc.

1 Comment