Esempio n. 1
0
        public async Task <IActionResult> StoreDatasetFromFile([FromForm] string name, [FromForm] IFormFile file)
        {
            _logger.LogInformation($"[{DateTime.Now}] POST: Upload file");

            try
            {
                var result = await _fileParser.GetStringAsync(file);

                await _datasetService.StoreDataset(_datasetParser.FromString(name, result));

                return(Ok("Dataset imported successfully!"));
            }
            catch (ArgumentException exception)
            {
                return(BadRequest(exception.Message));
            }
        }