Step 5 Create the work interface class files unit, which statement the IDemoUnitOfWork interface variables. It collects the interface class of the BLL and other functions of the generic repository.
Step 6 Create the work service class files unit, which implements the generic repository’s BLL class files and other functions. Don’t write non-related tasks in this file because this class should focus on how to implement the BLL class files and keep clean code rules, and doesn’t should write the non-related source code in it.
Step 7 Create the client-side, which will be used the source code and the files. It keeps following the dependency injection rule and uses the interface class methods, which also can use the abstract class methods, but the interface class method and the abstract method have a few different characteristics. This article doesn’t include its discussion and descript range. The interface class name sets “IUnitOfWorkClientServices.” The service class name sets “UnitOfWorkClientServices.”
Step 8 Create the unit of work pattern-related flies in the web projects, then register the related files in the “Startup.cs.”
// Unit of Work
services.AddScoped(typeof(IUnitOfWorkClientServices<>), typeof(UnitOfWorkClientServices<>)); Reference
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…
Mediator – It can let the program reduces chaotic dependencies between objects. This pattern can restrict the…