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.
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.
Template method – It means the program defines an algorithm skeleton in the superclass, which lets subclasses…
Strategy – It allows the programs to define a family of an algorithm, put each…
State – This pattern can let the program’s object alter its behavior when its internal state changes,…
Observer – It lets the programs define a subscription mechanism to notify multiple objects, which means when…
Null Object – Designed to act as a default value of an object. From Design Pattern –…
Memento – It allows the programs to save and restore the object’s previous state without revealing its…
View Comments