Answer the question
In order to leave comments, you need to log in
How to convert JSON to UML using C#?
I really want to try to create an application that, like MySQL WorckBench, would build a query execution plan graphically. The input is just the same plan in JSON format.
The problem is, this code is always dynamic, it is scaled from the type of the select query, for example:
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "totalprice",
"access_type": "ALL",
"rows": 1,
"filtered": 100
}
}
}
{
"query_block": {
"select_id": 1,
"grouping_operation": {
"using_temporary_table": true,
"using_filesort": true,
"nested_loop": [
{
"table": {
"table_name": "film",
"access_type": "range",
"possible_keys": [
"PRIMARY",
"idx_title"
],
"key": "idx_title",
"used_key_parts": [
"title"
],
"key_length": "767",
"rows": 43,
"filtered": 100,
"using_index": true,
"attached_condition": "(`sakila`.`film`.`title` like 'W%')"
}
},
{
"table": {
"table_name": "inventory",
"access_type": "ref",
"possible_keys": [
"PRIMARY",
"idx_fk_film_id"
],
"key": "idx_fk_film_id",
"used_key_parts": [
"film_id"
],
"key_length": "2",
"ref": [
"sakila.film.film_id"
],
"rows": 2,
"filtered": 100,
"using_index": true
}
...
Answer the question
In order to leave comments, you need to log in
here is a nice library json.codeplex.com
its api: james.newtonking.com/json/help/index.html usage
example:
Product product = new Product();
product.ExpiryDate = new DateTime(2008, 12, 28);
JsonSerializer serializer = new JsonSerializer();
serializer.Converters.Add(new JavaScriptDateTimeConverter());
serializer.NullValueHandling = NullValueHandling.Ignore;
using (StreamWriter sw = new StreamWriter(@"c:\json.txt"))
using (JsonWriter writer = new JsonTextWriter(sw))
{
serializer.Serialize(writer, product);
// {"ExpiryDate":new Date(1230375600000),"Price":0}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question