In this chapter, we have seen how to implement mapper classes, validators, and service classes. All these types work together using the dependency injection of .NET Core. Dependency registration usually happens through the use of extension methods that group the registered classes by following some criteria. In this case, I will group the registered classes in the following way:
- Services refer to all the service interfaces and classes defined in the Catalog.Domain project
- Mappers refer to all the mapper classes defined in the Catalog.Domain project
- Validations refer to all the fluent validation requirements and dependencies used by the application
Now that we have defined the logic behind the separation of dependency registration, we can proceed by defining a new DependencyRegistration static class in the Extensions folder in the Catalog.Domain project...