Better data (BioRad)

EC / IFX
FromBody bug fix
Made ID optional and are get all files now
This commit is contained in:
2023-03-08 12:47:22 -07:00
parent de048b6842
commit 8040a7c6b5
6 changed files with 248 additions and 87 deletions

View File

@ -15,20 +15,28 @@ public class ExportController : Controller, IExportController<IActionResult>
public ExportController(IExportRepository exportRepository) =>
_ExportRepository = exportRepository;
private static HeaderCommon GetHeaderCommon(Stream stream)
private static string? GetJson(Stream stream)
{
HeaderCommon? result;
string? result;
if (!stream.CanRead)
result = new();
result = null;
else
{
Task<string> task = new StreamReader(stream).ReadToEndAsync();
result = string.IsNullOrEmpty(task.Result) ? null : JsonSerializer.Deserialize<HeaderCommon>(task.Result);
result ??= new();
result = task.Result;
}
return result;
}
private static HeaderCommon GetHeaderCommon(Stream stream)
{
HeaderCommon? result;
string? json = GetJson(stream);
result = string.IsNullOrEmpty(json) ? null : JsonSerializer.Deserialize<HeaderCommon>(json);
result ??= new();
return result;
}
[HttpGet]
[Route("export")]
public IActionResult GetExport() =>