Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssougnez/f5ab1f6baf1685e9b57d3f310989c6b2 to your computer and use it in GitHub Desktop.
Save ssougnez/f5ab1f6baf1685e9b57d3f310989c6b2 to your computer and use it in GitHub Desktop.
public override void ConfigureMappings(IConfiguration config, ApplicationContext applicationContext)
{
var profiles = GetType()
.Assembly
.GetTypes()
.Where(t => t.BaseType == typeof(Profile))
.Select(t => Activator.CreateInstance(t) as Profile);
foreach (var profile in profiles)
{
config.AddProfile(profile);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment