public void InjectS3ClientWithOverridingConfig() { var builder = new ConfigurationBuilder(); builder.AddJsonFile("./TestFiles/GetClientConfigSettingsTest.json"); IConfiguration config = builder.Build(); ServiceCollection services = new ServiceCollection(); services.AddDefaultAWSOptions(config.GetAWSOptions()); services.AddAWSService<IAmazonS3>(new AWSOptions {Region = RegionEndpoint.EUCentral1 }); var serviceProvider = services.BuildServiceProvider(); var controller = ActivatorUtilities.CreateInstance<TestController>(serviceProvider); Assert.NotNull(controller.S3Client); Assert.Equal(RegionEndpoint.EUCentral1, controller.S3Client.Config.RegionEndpoint); }
static void SetService() { #region AWS Account and Services setup // See https://aws.amazon.com/blogs/developer/configuring-aws-sdk-with-net-core/ // for basics on how to use your AWSSDK credential store for local setup var serviceCollection = new ServiceCollection(); var path = Path.GetDirectoryName(typeof(Program).GetTypeInfo().Assembly.Location); var configuration = new ConfigurationBuilder() .SetBasePath(path) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .Build(); var awsOptions = configuration.GetAWSOptions(); serviceCollection.AddDefaultAWSOptions(awsOptions); serviceCollection.AddAWSService <IAmazonS3>(); serviceCollection.AddHttpClient("guimp", client => { client.BaseAddress = new Uri("https://www.acadianamazda.com/"); }); //serviceCollection.AddHttpClient<BpaApiTpmiClient>(); serviceCollection.AddAWSService <IAmazonLambda>(); _services = serviceCollection.BuildServiceProvider(); _s3Client = _services.GetService <IAmazonS3>(); _httpClientFactory = _services.GetService <IHttpClientFactory>(); //_bpaApiTpmiClient = _services.GetService<BpaApiTpmiClient>(); //_lambdaClient = _services.GetService<IAmazonLambda>(); #endregion }
private void ConfigureServices() { _serviceCollection = new ServiceCollection(); _serviceCollection.AddDefaultAWSOptions(new AWSOptions()); _serviceCollection.AddAWSService <IAmazonDynamoDB>(); _serviceCollection.AddAWSService <IAmazonS3>(); _serviceCollection.AddTransient <Handler>(); }
public static ServiceCollection Register(IConfiguration configuration, ServiceCollection services) { services.AddSingleton <IConfiguration>(configuration); services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddAWSService <IAmazonKinesis>(); // Binds the "Settings" section from appsettings.json to AppSettings var settings = configuration.Bind <DittoSettings>("Settings"); services.AddSingleton(settings); var destinationSettings = configuration.Bind <KinesisSettings>("Kinesis"); services.AddSingleton(destinationSettings); services.AddSingleton <AppService>(); services.AddSingleton <ILogger>(Log.Logger); services.AddSingleton <IEventStoreConnection>(provider => ConnectionFactory.CreateEventStoreConnection(provider.GetService <ILogger>(), settings.SourceEventStoreConnectionString, "Ditto:Source")); services.AddSingleton <IConsumerManager, CompetingConsumerManager>(); // Register replicating consumers foreach (var subscription in settings.Subscriptions) { services.AddSingleton <ICompetingConsumer>(provider => CreateConsumer(provider, settings, destinationSettings, subscription.StreamName, subscription.GroupName)); } return(services); }
private static async void RegisterServices(string[] args) { var services = new ServiceCollection(); services.AddLogging(builder => builder .AddConsole()); var EnvironmentType = Environment.GetEnvironmentVariable("NETCORE_ENVIRONMENT"); IConfiguration Configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddJsonFile($"appsettings.{EnvironmentType}.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables() .AddCommandLine(args) .Build(); services.Configure <AppConfig>(Configuration.GetSection("AppConfig")); services.AddDefaultAWSOptions(Configuration.GetAWSOptions()); services.AddTransient <App>(); services.AddAWSService <IAmazonS3>(); _serviceProvider = services.BuildServiceProvider(true); }
internal static IServiceCollection CreateServices(IConfiguration configuration) { var services = new ServiceCollection(); services.AddLogging(configure => configure.AddConsole()); // Add AWS services services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddAWSService <IAmazonSimpleNotificationService>(); // Add domain services services.AddSingleton <ITopicService, SnsTopicService>(); services.AddSingleton <ISubscriptionService, SubscriptionService>(); services.AddSingleton <IPublicationService <GameRank>, PublicationService <GameRank> >(); // Add managers services.AddSingleton <IGameRankPublicationManager, GameRankPublicationManager>(); // Add consoles services.AddSingleton <DashboardConsole>(); services.AddSingleton <TopicManagerConsole>(); services.AddSingleton <PublicationManagerConsole>(); services.AddSingleton <SubscriptionManagerConsole>(); return(services); }
public void InjectS3ClientWithFactoryBuiltConfig() { var expectRegion = RegionEndpoint.APSouth1; var expectProfile = "MockProfile"; var services = new ServiceCollection(); services.AddSingleton(new AWSSetting { Region = expectRegion, Profile = expectProfile }); services.AddDefaultAWSOptions(sp => { var setting = sp.GetRequiredService <AWSSetting>(); return(new AWSOptions { Region = setting.Region, Profile = setting.Profile }); }); services.AddAWSService <IAmazonS3>(); var serviceProvider = services.BuildServiceProvider(); var controller = ActivatorUtilities.CreateInstance <TestController>(serviceProvider); Assert.NotNull(controller.S3Client); Assert.Equal(expectRegion, controller.S3Client.Config.RegionEndpoint); }
private void ConfigureServices() { var configuration = new ConfigurationBuilder() .AddJsonFile("appsettings.json") .AddEnvironmentVariables() .Build(); _serviceCollection = new ServiceCollection(); _serviceCollection.AddCustomConfiguration(configuration); _serviceCollection.AddCustomIntegrations(); _serviceCollection.AddEventBus(); _serviceCollection.AddDefaultAWSOptions(configuration.GetAWSOptions()); _serviceCollection.AddSingleton <IConfiguration>(configuration); _serviceCollection.AddAWSService <IAmazonDynamoDB>(); _serviceCollection.AddTransient <IDynamoDBContext, DynamoDBContext>(); _serviceCollection.AddTransient <IRepository <ForeignCurrencyPrice>, Repository <ForeignCurrencyPrice> >(); _serviceCollection.AddLogging(config => { config.ClearProviders(); config.AddSerilog(GetLogger(configuration), true); }); _serviceCollection.AddTransient <IPrice <ForeignCurrencyPrice>, PriceFromPgp <ForeignCurrencyPrice> >(); _serviceCollection.AddAutoMapper(mce => { mce.AddProfile <DtoToDomainMapperProfile>(); }, typeof(Function).GetTypeInfo().Assembly); _serviceCollection.AddTransient <App>(); }
static void Main(string[] args) { var env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); var builder = new ConfigurationBuilder() .AddJsonFile($"appsettings.json", true, true) .AddJsonFile($"appsettings.{env}.json", true, true) .AddEnvironmentVariables(); Configuration = builder.Build(); var _serviceCollection = new ServiceCollection(); _serviceCollection.AddDefaultAWSOptions(Configuration.GetAWSOptions()); _serviceCollection.AddAWSService <IAmazonS3>(ServiceLifetime.Singleton); _serviceCollection.AddSingleton <IFileStorageService>( x => new S3BucketStorageService(x.GetRequiredService <IAmazonS3>(), BUCKET_NAME, REGION_NAME ) ); ServiceProvider = _serviceCollection.BuildServiceProvider(); MainAsync().Wait(); }
public static void Main(string[] args) { var serviceCollection = new ServiceCollection(); var path = Path.GetDirectoryName(typeof(Program).GetTypeInfo().Assembly.Location); var configuration = new ConfigurationBuilder() .SetBasePath(path) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .Build(); var awsOptions = configuration.GetAWSOptions(); serviceCollection.AddDefaultAWSOptions(awsOptions); serviceCollection.AddAWSService <IAmazonSQS>(); _services = serviceCollection.BuildServiceProvider(); SQSClient = _services.GetService <IAmazonSQS>(); //Console.Write("Initial Stage..."); //String url = "https://www.cars.com/"; //Console.WriteLine("Sending Request with url: " +url); //var response = SQSClient.GetQueueUrlAsync("awsgethtmlqueue"); //var qResp = SQSClient.SendMessageAsync(response.Result.QueueUrl, url).Result; //Console.Read(); //SetService(); //BeginTestAtRegionBucket(); TestStudent(); }
internal static IServiceCollection CreateServices(IConfiguration configuration) { var services = new ServiceCollection(); services.AddLogging(configure => configure.AddConsole()); // Add AWS services services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddAWSService <IAmazonDynamoDB>(); // Add repositories services.AddSingleton <IEntityRepository <BookEntity>, EntityRepository <BookEntity> >(); services.AddSingleton <ITableRepository, TableRepository>(); // Add book related services services.AddSingleton <IBooksManager, BooksManager>(); services.AddSingleton <IBooksTableManager, BooksTableManager>(); // Add consoles services.AddSingleton <DashboardConsole>(); services.AddSingleton <TableManagerConsole>(); services.AddSingleton <BookManagerConsole>(); return(services); }
/// <summary> /// Contructor initializing test fixture. /// </summary> public BucketIntegrationFixture() { // Setup Configuration var configBuilder = new ConfigurationBuilder() .AddJsonFile("appsettings.json", optional: false); var configuration = configBuilder.Build(); AWSOptions options = configuration.GetAWSOptions(); // S3 Configuration BucketName = Environment.GetEnvironmentVariable("BUCKET_NAME"); BucketWebsite = $"http://{BucketName}.s3-website.{options.Region.SystemName}.amazonaws.com/"; var storageConfig = new PiranhaS3StorageOptions { BucketName = BucketName, PublicUrlRoot = BucketWebsite }; // Service Provider IServiceCollection services = new ServiceCollection(); services.AddPiranhaS3StorageOptions(storageConfig); services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddPiranhaS3Storage(); services.AddAWSService <IAmazonS3>(); var serviceProvider = services.BuildServiceProvider(); // Get the services S3Storage = serviceProvider.GetService <IStorage>(); S3Client = serviceProvider.GetService <IAmazonS3>(); }
public AmazonIdentification(IConfiguration configuration) { var services = new ServiceCollection(); services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddAWSService <IAmazonRekognition>(); var provider = services.BuildServiceProvider(); _amazonRekognition = (IAmazonRekognition)provider.GetRequiredService(typeof(IAmazonRekognition)); }
private void ConfigureServices(ServiceCollection serviceCollection) { serviceCollection.AddTransient <IEnvironmentService, EnvironmentService>(); serviceCollection.AddTransient <ITelegramService, TelegramService>(); serviceCollection.AddTransient <ISubscribtionStore, AmazonDynamoDBService>(); serviceCollection.AddAWSService <IAmazonDynamoDB>(new Amazon.Extensions.NETCore.Setup.AWSOptions() { Region = Amazon.RegionEndpoint.EUWest1 }); }
private static IServiceCollection ConfigureServices() { var services = new ServiceCollection(); // This line is required but perhaps it shouldn't be? //services.AddDefaultAWSOptions(Configuration.GetAWSOptions()); services.AddAWSService <IAmazonDynamoDB>(); return(services); }
private void ConfigureServices(ServiceCollection serviceCollection) { serviceCollection.AddTransient <IBookmarkService, BookmarkService>(); serviceCollection.AddTransient <IKeyValueStore, AmazonS3Service>(); serviceCollection.AddTransient <IQueueService, AmazonQueueService>(); serviceCollection.AddTransient <ISubscribtionService, AmazonDynamoDBService>(); serviceCollection.AddTransient <IEnvironmentService, EnvironmentService>(); serviceCollection.AddTransient <IKandilliService, KandilliService>(); serviceCollection.AddAWSService <IAmazonS3>(new Amazon.Extensions.NETCore.Setup.AWSOptions() { Region = Amazon.RegionEndpoint.EUWest1 }); serviceCollection.AddAWSService <IAmazonSQS>(new Amazon.Extensions.NETCore.Setup.AWSOptions() { Region = Amazon.RegionEndpoint.EUWest1 }); serviceCollection.AddAWSService <IAmazonDynamoDB>(new Amazon.Extensions.NETCore.Setup.AWSOptions() { Region = Amazon.RegionEndpoint.EUWest1 }); }
private void ConfigureServices(ServiceCollection services) { var configuration = new ConfigurationBuilder().AddSystemsManager("/gu/api/").Build(); services.AddAWSService <IAmazonSimpleSystemsManagement>(new Amazon.Extensions.NETCore.Setup.AWSOptions() { Region = Amazon.RegionEndpoint.EUWest1 }); services.AddLogging(); services.AddSingleton <IConfiguration>(configuration); services.AddTransient <IMailChimpService, MailChimpService>(); }
/// <summary> /// Default constructor that Lambda will invoke. /// </summary> public Functions() { // GetHtml(); configuration var serviceCollection = new ServiceCollection(); var configuration = new ConfigurationBuilder().Build(); var awsOptions = configuration.GetAWSOptions(); awsOptions.Credentials = new EnvironmentVariablesAWSCredentials(); serviceCollection.AddDefaultAWSOptions(awsOptions); serviceCollection.AddAWSService <IAmazonSQS>(); Services = serviceCollection.BuildServiceProvider(); SQSClient = Services.GetService <IAmazonSQS>(); }
private void ConfigureServices(ServiceCollection services) { var configuration = new ConfigurationBuilder().AddEnvironmentVariables().AddSystemsManager("/gu/bot/").Build(); services.AddAWSService <IAmazonDynamoDB>(new Amazon.Extensions.NETCore.Setup.AWSOptions() { Region = Amazon.RegionEndpoint.EUWest1 }); services.AddAWSService <IAmazonSimpleSystemsManagement>(new Amazon.Extensions.NETCore.Setup.AWSOptions() { Region = Amazon.RegionEndpoint.EUWest1 }); services.AddAWSService <IAmazonS3>(new Amazon.Extensions.NETCore.Setup.AWSOptions() { Region = Amazon.RegionEndpoint.EUWest1 }); services.AddSingleton <IConfiguration>(configuration); services.AddTransient <IBotService, BotService>(); services.AddTransient <ITelegramService, TelegramService>(); services.AddTransient <ISheetService, SheetService>(); services.AddTransient <ISheetRepository, SheetRepository>(); services.AddTransient <IAmazonDynamoDbService, AmazonDynamoDbService>(); }
public async Task Given_sns_notification_sent_successfully_then_the_notification_should_contain_the_correct_message() { // Given var collection = new ServiceCollection(); collection.AddSnsTestReceiver(new SnsTestReceiverOptions { BaseUrl = new Uri("http://localhost:5000/") }); collection.AddAWSService <IAmazonSimpleNotificationService>(new AWSOptions { DefaultClientConfig = { ServiceURL = "http://localhost:4566" } }); var expectedId = Guid.NewGuid().ToString(); var expectedTestObject = new TestObject { IntProperty = 123, StringProperty = expectedId }; var request = new PublishRequest { TopicArn = "arn:aws:sns:eu-west-1:000000000000:test-notifications", Message = JsonSerializer.Serialize(expectedTestObject), Subject = "MyTestNotification" }; await using var sp = collection.BuildServiceProvider(); var sns = sp.GetService <IAmazonSimpleNotificationService>(); var testReceiver = sp.GetService <ISnsTestReceiverClient>(); // When await sns.PublishAsync(request); // Then var result = await testReceiver.SearchAsync(expectedId); result.Should().HaveCount(1); result.Single().Subject.Should().Be(request.Subject); var testObject = JsonSerializer.Deserialize <TestObject>(result.Single().Message); testObject.IntProperty.Should().Be(123); testObject.StringProperty.Should().Be(expectedId); }
protected IntegrationTestsBase(WebApplicationFactory <Startup> factory) { factory.Server.AllowSynchronousIO = true; HttpClient = factory.CreateClient(); var configuration = factory.Server.Host.Services.GetService <IConfiguration>(); TopicArn = configuration.GetValue <string>("SNS:TopicArn"); _serviceCollection.AddAWSService <IAmazonSimpleNotificationService>(configuration.GetAWSOptions("SNS")); _serviceProvider = _serviceCollection.BuildServiceProvider(); NotificationService = _serviceProvider.GetService <IAmazonSimpleNotificationService>(); }
public void InjectS3ClientWithDefaultConfig() { var builder = new ConfigurationBuilder(); builder.AddJsonFile("./TestFiles/GetClientConfigSettingsTest.json"); IConfiguration config = builder.Build(); ServiceCollection services = new ServiceCollection(); services.AddDefaultAWSOptions(config.GetAWSOptions()); services.AddAWSService <IAmazonS3>(); var serviceProvider = services.BuildServiceProvider(); var controller = ActivatorUtilities.CreateInstance <TestController>(serviceProvider); Assert.NotNull(controller.S3Client); Assert.Equal(RegionEndpoint.USWest2, controller.S3Client.Config.RegionEndpoint); }
internal static IServiceCollection CreateServices(IConfiguration configuration) { var services = new ServiceCollection(); services.AddLogging(configure => configure.AddConsole()); // Add AWS services services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddAWSService <IAmazonSQS>(); // Add managers services.AddSingleton <IGameRankQueueManager, GameRankQueueManager>(); services.AddSingleton <IQueueManager, QueueManager>(); // Add consoles services.AddSingleton <DashboardConsole>(); services.AddSingleton <GameRankQueueManagerConsole>(); services.AddSingleton <QueueManagerConsole>(); return(services); }
static async Task Main(string[] args) { var configurationBuilder = new ConfigurationBuilder(); configurationBuilder.AddObject(new { AWS = new { Region = RegionEndpoint.EUWest1.SystemName }, S3 = new { BucketName = "emg-tech-temp", Prefix = "test" } }); var configuration = configurationBuilder.Build(); var services = new ServiceCollection(); services.AddOptions(); services.Configure <S3Options>(configuration.GetSection("S3")); services.AddSingleton <IMessenger, S3Messenger>(); services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddAWSService <IAmazonS3>(); var serviceProvider = services.BuildServiceProvider(); var messenger = serviceProvider.GetRequiredService <IMessenger>(); await messenger.WriteMessage("Hello world"); Console.WriteLine("Done"); }
static void Main(string[] args) { var path = Path.GetDirectoryName(typeof(Program).GetTypeInfo().Assembly.Location); var configurations = new ConfigurationBuilder() .SetBasePath(path) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .Build(); var services = new ServiceCollection(); var awsOptions = configurations.GetAWSOptions(); services.AddDefaultAWSOptions(awsOptions); services.AddAWSService <IAmazonS3>(); var serviceProvider = services.BuildServiceProvider(); var s3Client = serviceProvider.GetService <IAmazonS3>(); Debug.Assert(s3Client != null); Console.WriteLine("Wroks - using AWSSDK.Extensions.NETCore.Setup v3.3.0.3"); Console.ReadLine(); }
internal async static Task Main(string[] args) { var configuration = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) .AddJsonFile("appSettings.json") .Build(); var services = new ServiceCollection(); services.AddLogging(configure => configure.AddConsole()); services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddAWSService <IAmazonS3>(); services.AddTransient <IS3Service, S3Service>(); var provider = services.BuildServiceProvider(); var client = provider.GetRequiredService <IS3Service>(); var defaultForegroundColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Yellow; Console.WriteLine(@" ___ ______ ____ _____ ____ "); Console.WriteLine(@" / \ \ / / ___| / ___|___ / | _ \ ___ _ __ ___ ___ "); Console.WriteLine(@" / _ \ \ /\ / /\___ \ \___ \ |_ \ | | | |/ _ \ '_ ` _ \ / _ \ "); Console.WriteLine(@" / ___ \ V V / ___) | ___) |__) | | |_| | __/ | | | | | (_) |"); Console.WriteLine(@"/_/ \_\_/\_/ |____/ |____/____/ |____/ \___|_| |_| |_|\___/ "); Console.ForegroundColor = defaultForegroundColor; do { Console.WriteLine(); Console.WriteLine(getOptions()); var selection = Console.ReadLine(); if (selection == "q") { break; } else if (selection == "ls") { var buckets = await client.ListAllBucketsAsync(); if (buckets != null) { Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(JsonConvert.SerializeObject(buckets, Formatting.Indented)); } } else if (selection == "mb") { Console.Write("Enter bucket name: "); var bucketName = Console.ReadLine(); var createdBucket = await client.CreateBucketAsync(bucketName); if (createdBucket != null) { Console.ForegroundColor = ConsoleColor.Cyan; Console.WriteLine(JsonConvert.SerializeObject(createdBucket, Formatting.Indented)); } } else if (selection == "rb") { Console.Write("Enter bucket name: "); var bucketName = Console.ReadLine(); var deletedBucket = await client.DeleteBucketAsync(bucketName); if (deletedBucket != null) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(JsonConvert.SerializeObject(deletedBucket, Formatting.Indented)); } } Console.ForegroundColor = defaultForegroundColor; } while (true); string getOptions() { var options = new StringBuilder(); options.AppendLine("q - Quit"); options.AppendLine("ls - List all buckets"); options.AppendLine("mb - Create bucket"); options.AppendLine("rb - Delete bucket"); return(options.ToString()); } Console.WriteLine("Done!"); }
static async Task Main(string[] args) { Environment.SetEnvironmentVariable("AWS_PROFILE", "ticklelabs"); var configuration = SetupConfiguration(args); var services = new ServiceCollection(); services.AddSingleton(configuration); services.AddHttpClient <GitHubClient>(o => { o.BaseAddress = new Uri("https://api.github.com"); o.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("token", ""); o.DefaultRequestHeaders.Add("User-Agent", "TorathonGitScraper"); }); services.AddDefaultAWSOptions(configuration.GetAWSOptions()); services.AddAWSService <IAmazonDynamoDB>(); services .AddTransient <DynamoClient>(); var serviceProvider = services.BuildServiceProvider(); gitHubClient = serviceProvider.GetService <GitHubClient>(); const string allReposFile = @"D:\dev\TorathonGitScraper\repos.json"; var reposFileInfo = new FileInfo(allReposFile); List <GitHubRepo> repos; if (!reposFileInfo.Exists) { Console.WriteLine("Repo file doesn't exist: fetching."); repos = await gitHubClient.GetAllRepos(); using (var writer = new StreamWriter(allReposFile, append: false)) { await writer.WriteLineAsync(JsonConvert.SerializeObject(repos)); } Console.WriteLine("Finished writing to file."); } else { using (var sr = reposFileInfo.OpenText()) { var content = sr.ReadLine(); repos = JsonConvert.DeserializeObject <List <GitHubRepo> >(content); } } var totalRepos = repos.Count; const int batchSize = 50; var batchesNeeded = (totalRepos / 50) + 1; var repoFilesTasks = new Dictionary <string, Task <List <GitHubFile> > >(); for (var batch = 0; batch <= batchesNeeded; batch++) { var lowerBound = batch * batchSize; var range = lowerBound + batchSize > totalRepos ? totalRepos - lowerBound : batchSize; var batchItems = repos.GetRange(lowerBound, range); foreach (var item in batchItems) { repoFilesTasks.Add(item.Name, gitHubClient.GetCsProjFiles(item)); } batch++; } var dynamoDbClient = serviceProvider.GetService <DynamoClient>(); foreach (var(repo, filesTask) in repoFilesTasks) { try { Console.WriteLine(repo); var files = await Task.WhenAll(filesTask); var dependencies = new List <ProjectDependencies>(); foreach (var file in files.SelectMany(x => x)) { var fileContent = await GetRawFileContent(file); var refs = file.GetAllPackageRefs(fileContent); dependencies.AddRange(refs.Select(x => new ProjectDependencies { Project = file.Name.Replace(".csproj", ""), Dependencies = refs })); } await dynamoDbClient.Save(new RepoDependencies { Name = repo, ProjectsDependencies = dependencies }); } catch (Exception e) { Console.WriteLine($"Failed to get file content for repo {repo}"); } } }