I profili di Automapper non vengono caricati all'avvio?

I profili di Automapper non vengono caricati all'avvio?

Lo capisco. Poiché le mie mappature sono in un progetto diverso, ho fatto due cose

  1. Dal mio progetto API (dove si trova Startup.cs, aggiunto un riferimento al mio progetto xxxMapprings)
  2. in ConfigureServices ho usato l'overload AddAutoMapper che ottiene un Assembly:

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();
    
        //register automapper
        services.AddAutoMapper(Assembly.GetAssembly(typeof(StatusMappingProfile))); //If you have other mapping profiles defined, that profiles will be loaded too.