Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created July 18, 2019 08:46
Show Gist options
  • Select an option

  • Save ntakouris/86d9ef98d2226257567166ca099bab09 to your computer and use it in GitHub Desktop.

Select an option

Save ntakouris/86d9ef98d2226257567166ca099bab09 to your computer and use it in GitHub Desktop.
var installers = typeof(Startup).Assembly.ExportedTypes.Where(x =>
typeof(IInstaller).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract).Select(Activator.CreateInstance).Cast<IInstaller>().ToList();
installers.ForEach(installer => installer.InstallServices(services, configuration));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment