asp.net-core.net-coredomain-driven-designinversion-of-controlcross-cutting-concerns

.NET CORE - DDD + CrossCutting + External API


I am developing a .NET Core project using the DDD, IoC, CrossCutting.

The CrossCutting.IoC project, the responsible for register the project dependencies and performing the inversion of control function and this project has the reference of the other projects.

Now the need has come to do an external integration by calling an external API. I don't want to escape the design pattern.

Which of the following is correct:

  1. Use an interface to integrate and register with IoC
  2. Create a project called CrossCutting.Integration
  3. None of the options. What is the best option?

Solution

  • You can create two new projects. One with the contracts (Interfaces) that will be referenced in all other projects that needs to call this integration. And other with the concrete implementation of this integration, and will be referenced only by IoC project.

    Ex: MyIntegration.Contracts & MyIntegration