I'm trying to follow clean architecture with DDD using a solution that has the following three project types:
- MyProject.Core (entities, interfaces, and services)
- MyProject.Infrastructure (repositories, eventbus, loggers, factories???)
- MyProject.API (controllers)
I have a factory class MapperFactory that implements an interface IMapperFactory which returns an IMapperService based on a MapType passed into the factory. Implementations of IMapperService reside in the Core layer.
I'm struggling to understand where the Factory implementation classes should reside. All my repositories are implemented in the infrastructure project but domain services are implemented in the Core project per clean architecture guidelines (at least how I read them)
I feel like the implementation for the factory should be in the core project because that's where all the implementations that it needs to create reside, but not sure. If it should be in the core project, what type of object would it be since it's not an entity, service, or interface?