Created
September 28, 2018 23:06
-
-
Save bayological/b004b092a9a8a644f8469aad255c355e to your computer and use it in GitHub Desktop.
Registration of classes in the same namespace as ICat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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