Skip to content

Instantly share code, notes, and snippets.

@ayende
Created April 6, 2020 06:26
Show Gist options
  • Save ayende/be77fdef629db70063cc9d5c79fffacf to your computer and use it in GitHub Desktop.
Save ayende/be77fdef629db70063cc9d5c79fffacf to your computer and use it in GitHub Desktop.
serviceAssemblies = ( Assembly.Load("MyApp"), )
for asm in serviceAssemblies:
for type in asm.GetTypes():
continue unless type.NameSpace == "MyApp.Services"
continue if type.IsInterface or type.IsAbstract or type.GetInterfaces().Length == 0
Component(type.FullName, type.GetInterfaces()[0], type)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment