Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialize dynamic format issue #82

Open
dhutapratama opened this issue May 24, 2018 · 0 comments
Open

Deserialize dynamic format issue #82

dhutapratama opened this issue May 24, 2018 · 0 comments

Comments

@dhutapratama
Copy link

Hello,

I was try to deserialize json data to dynamic format by wiki documentation but always fail.
and then i have an idea to change the format back to JsonObject and working.

Your Wiki Reference
Deserialize JSON String
Using dynamic

dynamic json = SimpleJson.DeserializeObject(data);
string firstName = json.first_name;
DateTime startDate = json.startDate
int voteCount = json.voteCount
List results = json.results;

My right way
Deserialize JSON String
Using dynamic

dynamic json = SimpleJson.DeserializeObject(data);
string firstName = json["first_name"];
DateTime startDate = json["startDate"];
int voteCount = json["voteCount"];
List results = json["results"];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant