Skip to content

Instantly share code, notes, and snippets.

@bayological
Created September 28, 2018 23:06
Show Gist options
  • Save bayological/b004b092a9a8a644f8469aad255c355e to your computer and use it in GitHub Desktop.
Save bayological/b004b092a9a8a644f8469aad255c355e to your computer and use it in GitHub Desktop.
Registration of classes in the same namespace as ICat
public static void Run(IServiceCollection services)
{
services.Scan(scan => scan
.FromAssemblyOf<ICat>()
.AddClasses(classes => classes.InNamespaceOf<ICat>())
.AsImplementedInterfaces()
.WithTransientLifetime());
services.AddSingleton<IApplication, Application>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment