Profile在当前程序集用法
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
Profile不在当前程序集用法
AutoMapper.IConfigurationProvider config = new MapperConfiguration(cfg =>
{
cfg.AddProfile<Post>();
});
services.AddSingleton(config);
services.AddScoped<IMapper, Mapper>();