// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { services.AddLogging(); services.AddHttpClient(); //This key is temporary for demo purposes only and will stop working soon //you will need to request your own by writing an email to [email protected] PTI.Microservices.Library.Configuration.GlobalPackageConfiguration.RapidApiKey = "a3893edcbfmsh2efa1861dcc7a10p159864jsnf17e667d1bf7"; services.AddTransient <ILogger <CustomHttpClientHandler>, Logger <CustomHttpClientHandler> >(); services.AddTransient <ILogger <AzureBingSearchService>, Logger <AzureBingSearchService> >(); services.AddTransient <ILogger <AzureVideoIndexerService>, Logger <AzureVideoIndexerService> >(); AzureVideoIndexerConfiguration azureVideoIndexerConfiguration = this.Configuration .GetSection("AzureConfiguration:AzureVideoIndexerConfiguration") .Get <AzureVideoIndexerConfiguration>(); AzureBingSearchConfiguration azureBingSearchConfiguration = this.Configuration .GetSection("AzureConfiguration:AzureBingSearchConfiguration") .Get <AzureBingSearchConfiguration>(); services.AddSingleton <AzureVideoIndexerConfiguration>(azureVideoIndexerConfiguration); services.AddSingleton <AzureBingSearchConfiguration>(azureBingSearchConfiguration); services.AddTransient <CustomHttpClientHandler>(); services.AddTransient <CustomHttpClient>(); services.AddTransient <AzureBingSearchService>(); services.AddTransient <AzureVideoIndexerService>(); services.AddControllersWithViews(); services.AddRazorPages(); }
private void ConfigureAzureVideoIndexer(IServiceCollection services) { AzureVideoIndexerConfiguration azureVideoIndexerConfiguration = Configuration.GetSection($"AzureConfiguration:{nameof(AzureVideoIndexerConfiguration)}") .Get <AzureVideoIndexerConfiguration>(); services.AddSingleton(azureVideoIndexerConfiguration); services.AddTransient <AzureVideoIndexerService>(); }
public VideoService(AzureVideoIndexerService azureVideoIndexerService, AzureBlobStorageService azureBlobStorageService, DataStorageConfiguration dataStorageConfiguration, ICurrentUserProvider currentUserProvider, FairplaytubeDatabaseContext fairplaytubeDatabaseContext, AzureVideoIndexerConfiguration azureVideoIndexerConfiguration, CustomHttpClient customHttpClient, IHubContext <NotificationHub, INotificationHub> hubContext, EmailService emailService, IConfiguration configuration) { this.AzureVideoIndexerService = azureVideoIndexerService; this.AzureBlobStorageService = azureBlobStorageService; this.DataStorageConfiguration = dataStorageConfiguration; this.CurrentUserProvider = currentUserProvider; this.FairplaytubeDatabaseContext = fairplaytubeDatabaseContext; this.AzureVideoIndexerConfiguration = azureVideoIndexerConfiguration; this.CustomHttpClient = customHttpClient; this.HubContext = hubContext; this.EmailService = emailService; this.Configuration = configuration; }