Created
May 30, 2020 11:59
-
-
Save alimozdemir/9daccfe20c31d1da255718c33560d0fb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 void ConfigureServices(IServiceCollection services) | |
{ | |
... | |
services.Scan(i => | |
i.FromCallingAssembly() | |
.InjectableAttributes() | |
); | |
/* Or */ | |
services.Scan(i => | |
i.FromCallingAssembly() | |
.InjectableAttribute(ServiceLifetime.Transient) | |
.InjectableAttribute(ServiceLifetime.Scoped) | |
.InjectableAttribute(ServiceLifetime.Singleton) | |
); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment