private static async Task LoadConfiguredSampleFileAsync(SampleFileConfig sampleFileConfig, SampleFileStore store, HttpClient httpClient)
        {
            var content = await httpClient.GetStringAsync($"{SAMPLE_FILES_LOCATION}/{sampleFileConfig.Path}");

            var fileSpecification = new SampleFile {
                Name = sampleFileConfig.Name, Content = content
            };

            store.AddSampleFile(fileSpecification);
        }
Esempio n. 2
0
        public OperationResult <int> AddSampleFile(SampleFile sampleFile)
        {
            var newSampleFile = new SampleFile
            {
                Id      = ++_lastGeneratedId,
                Name    = sampleFile.Name,
                Content = sampleFile.Content
            };

            _sampleFiles.Add(newSampleFile);

            return(OperationResult <int> .CreateSucced(newSampleFile.Id));
        }