Examples below are using the injected Business Layer class _categoryBusinessLayer or (_productBusinessLayer). Dependency injection improves the decoupling of objects. It provides a way to separate the creation of an object from its usage.

To use the Business Layer object, it is injected from MVC's start up application, the program.cs to the constructor of the class using it. For the purpose of these examples, the CategoryBusinessLayer can be injected to the Controller that's going to use it.

Again, all these code are already generated.