Better data (BioRad)
EC / IFX FromBody bug fix Made ID optional and are get all files now
This commit is contained in:
@ -30,18 +30,23 @@ public partial class InboundController : ControllerBase, IInboundController<IAct
|
||||
_MetrologyRepository = metrologyRepository;
|
||||
}
|
||||
|
||||
private static JToken GetJToken(Stream stream)
|
||||
private static string? GetJson(Stream stream)
|
||||
{
|
||||
JToken jsonbody;
|
||||
string? result;
|
||||
if (!stream.CanRead)
|
||||
jsonbody = JToken.Parse("{}");
|
||||
result = null;
|
||||
else
|
||||
{
|
||||
if (stream.CanSeek)
|
||||
_ = stream.Seek(0, SeekOrigin.Begin);
|
||||
string json = new StreamReader(stream).ReadToEnd();
|
||||
jsonbody = JToken.Parse(json);
|
||||
Task<string> task = new StreamReader(stream).ReadToEndAsync();
|
||||
result = task.Result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static JToken GetJToken(Stream stream)
|
||||
{
|
||||
string? json = GetJson(stream);
|
||||
JToken jsonbody = string.IsNullOrEmpty(json) ? JToken.Parse("{}") : JToken.Parse(json);
|
||||
return jsonbody;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user