public static async Task LoadFileSpecsAsync(FileSpecificationsStore store, HttpClient httpClient) { var fileSpecConfigs = await httpClient.GetFromJsonAsync <FileSpecConfig[]>($"{SAMPLE_FILES_LOCATION}/file-specs-config.json"); foreach (var fileSpecConfig in fileSpecConfigs) { await LoadConfiguredFileSpecAsync(fileSpecConfig, store, httpClient); } }
private static async Task LoadConfiguredFileSpecAsync(FileSpecConfig fileSpecConfig, FileSpecificationsStore store, HttpClient httpClient) { var content = await httpClient.GetStringAsync($"{SAMPLE_FILES_LOCATION}/{fileSpecConfig.Path}"); var fileSpecification = new FileSpecification { Name = fileSpecConfig.Name, Description = fileSpecConfig.Description, Content = content }; store.AddFileSpecification(fileSpecification); }