I have an application (NET Core) with many assemblies:
On WebAPI assembly I registered automapper profiles automatically with this line:
services.AddAutoMapper();
With this line I can convert view models to DTO (and backwards)
But I need register profiles located on Services layer to convert DTO to Domain entities (and backwards)
Evidently, Automapper not found this profiles.
What's the best way to register profiles from different assemblies?
I use services.AddAutoMapper(params Assembly[] assemblies).
for example:
services.AddAutoMapper(
typeof(Startup).GetTypeInfo().Assembly,
typeof(Class_In_Other_Assembly).GetTypeInfo().Assembly
);