orleans
orleans copied to clipboard
Persistence not stored as json in DB
Hi, I am learning Orleans I have just created the sample provided in the docs. I found in the docs that UseJson is the default now. But still, the grains are stored as binary in the database.

I am attaching the code zip file below for you to look over.
NOTE:- Tried a lot to get any information from the document, but I guess the document is not complete or missing the updates.
cc @benjaminpetit I think we should address this.
It's encoded as JSON but stored as binary, confusingly. In other words, you could decode that blob as UTF-8
@ReubenBond is there any config change I can do to store it as JSON not binary?
I tried to decode the value in UTF-8 via the code below but am not getting the JSON back am I doing something wrong?
using System;
using System.Text;
string x="0x7B22246964223A2231222C222474797065223A2255726C44657461696C732C204F726C65616E7355524C53686F7274656E6572222C2246756C6C55726C223A2268747470733A2F2F6D6963726F736F66746767672E636F6D222C2253686F7274656E6564526F7574655365676D656E74223A223944304234393545222C224D79";
var y = Encoding.ASCII.GetBytes(x);
var z= System.Text.Encoding.UTF8.GetString(y);
Console.WriteLine("🌄"+z);
Meanwhile this is getting fixed you should be able to get the data using
select cast(PayloadBinary as varchar(MAX)), * from OrleansStorage
Meanwhile this is getting fixed you should be able to get the data using
select cast(PayloadBinary as varchar(MAX)), * from OrleansStorage
Let me try this.
the cast to varchar(MAX) is working for me. does seem strange to have the double serialization. Is the intent to use the transport serializer? e.g. [generateserializer]