private void BuildContainer(IServiceCollection serviceCollection) { serviceCollection.AddScoped <GetPageOfShowsUseCase>(); var showStorageAdapter = new ShowStorageAdapter(new ShowStorageAdapterSettings(_settings.CosmosDbAccountEndpoint, _settings.CosmosDbAccountKey)); showStorageAdapter.Register(serviceCollection); }
private static void ConfigureApplication(IConfigurationRoot configuration, IServiceCollection serviceCollection) { var apiSettings = configuration.GetSection("tvMazeApi").Get <TvMazeApiSettings>(); var showDbSettings = configuration.GetSection("showsDatabaseSettings").Get <ShowDatabaseSettings>(); serviceCollection.AddScoped <GetNewMoviesUseCase>(); serviceCollection.AddHttpClient(nameof(ITvMazeClient), c => c.BaseAddress = new Uri(apiSettings.BaseUrl)); var showStorageAdapter = new ShowStorageAdapter(new ShowStorageAdapterSettings(showDbSettings.CosmosDbAccountEndpoint, showDbSettings.CosmosDbAccountKey)); showStorageAdapter.Register(serviceCollection); var tvMazeScraperAdapter = new TvMazeShowInformationAdapter(); tvMazeScraperAdapter.Register(serviceCollection); }