In previous versions of AutoMapper I used to be able to configure AutoMapper like this:
public static class AutoMapperFactory
{
public static IConfigurationProvider CreateMapperConfiguration()
{
var config = new MapperConfiguration(cfg =>
{
//Scan *.UI assembly for AutoMapper Profiles
var assembly = Assembly.GetAssembly(typeof(AutoMapperFactory));
cfg.AddProfiles(assembly);
cfg.IgnoreAllUnmapped();
});
return config;
}
}
Now, the line that says cfg.AddProfiles(assembly)
is giving me the error: Argument 1: cannot convert from 'System.Reflection.Assembly' to 'System.Collections.Generic.IEnumerable<AutoMapper.Profile>
How can I get an IEnumerable<AutoMapper.Profile>
to pass as a parameter for AddProfiles
?