Last active
December 16, 2019 09:26
-
-
Save takahirohonda/1d7b957ac462c4345c0fb0b7dbac2a69 to your computer and use it in GitHub Desktop.
Startup - ASP.NET DI Out of the box way
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) | |
{ | |
// Add dependencies manually | |
services.AddScoped(typeof(IAppLogger<>), typeof(LoggerAdapter<>)); | |
services.AddScoped(typeof(IEfRepository<>), typeof(EfRepository<>)); | |
services.AddScoped<IAppsRepository, AppsRepository>(); | |
services.AddScoped<IAppReviewRepository, AppReviewRepository>(); | |
services.AddScoped<IAppCategoryRespository, AppCategoryRespository>(); | |
... | |
services.AddMvc() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment