internal static void SetupIoC(this IServiceCollection serviceCollection, AppSettings appSettings, IConfiguration configuration)
        {
            InternalDependenciesProfile.Bootstrap(serviceCollection);

            CommonProfile.Register(serviceCollection, appSettings, configuration);
            StorageProfile.Register(serviceCollection, appSettings);
            LoggingProfile.RegisterApiLogger(serviceCollection, "Api");
            MediatRProfile.Register(serviceCollection, typeof(Startup).Assembly);
            AutoMapperProfile.Register(serviceCollection, typeof(Startup).Assembly);
        }
Beispiel #2
0
        private static ServiceProvider BuildContainer(IServiceCollection serviceCollection, bool isIntegrationTests)
        {
            var(config, appSettings) = isIntegrationTests ? BuildAppSettings() : BuildFakeAppSettings();

            RegisterTestDependencies(serviceCollection, appSettings);
            StorageProfile.Register(serviceCollection, appSettings);
            CommonProfile.Register(serviceCollection, appSettings, config);
            MediatRProfile.Register(serviceCollection);
            AutoMapperProfile.Register(serviceCollection);

            return(serviceCollection.BuildServiceProvider());
        }