Better data (BioRad)
EC / IFX FromBody bug fix Made ID optional and are get all files now
This commit is contained in:
@ -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() =>
|
||||
|
Reference in New Issue
Block a user