JsonProvider supports loading data from uri, stream, and stream reader, but not JsonValue which is inconvenient.
Now I had to use it like this:
use ms = new MemoryStream()
use w = new StreamWriter(ms, leaveOpen=false)
value.WriteTo(w, JsonSaveOptions.DisableFormatting)
w.Flush()
ms.Seek(0L, SeekOrigin.Begin) |> ignore
let record = DayCloseData.Load(ms)
Instead of just let record = = DayCloseData.Load(value)
If you a curious why I need this, I can explain.
Some services return such payload:
{
"history": {
"2020-01-10": {
...
},
"2020-01-11": {
...
}
}
}
JsonProvider supports loading data from uri, stream, and stream reader, but not
JsonValuewhich is inconvenient.Now I had to use it like this:
Instead of just
let record = = DayCloseData.Load(value)If you a curious why I need this, I can explain.
Some services return such payload: