Ekrem Tapan

Ekrem Tapan

  • NA
  • 967
  • 81.2k

Json data parse to model

Jun 4 2018 8:43 PM
hi all, 
 
i have get some terrible with below json data, cannot parse to model, but i dont know why, already created model throug json object, bu still cannot ?
 
c# code : 
  1. //first :   
  2.   
  3. JObject jsonResponse = JObject.Parse(json);  
  4.                     JObject objResponse = (JObject)jsonResponse["Item"];  
  5.                     Dictionary<string, JArray> _Data = Newtonsoft.Json.JsonConvert.DeserializeObject<Dictionary<string, JArray>>(objResponse.ToString());  
  6.   
  7. //second  
  8.   
  9. var docss = Json.JsonParser.Deserialize<Model.Example>(jsonText);  
 
 
json format : 
  1. {  
  2.       "s_type""Document",  
  3.       "s_typeId""B88C14B99EF449828C5D926E39EE8B89",  
  4.       "s_id""6D387DF8EA1F460C998F8D28D0FEC76C",  
  5.       "classification""Documents",  
  6.       "config_id": {  
  7.         "s_keyed_name""D-180516002",  
  8.         "s_type""Document",  
  9.         "y_text""6D387DF8EA1F460C998F8D28D0FEC76C"  
  10.       },  
  11.       "created_by_id": {  
  12.         "s_keyed_name""PM1",  
  13.         "s_type""User",  
  14.         "y_text""D01240E9F0BB467587B27BC975AC88FC"  
  15.       },  
  16.       "created_on""2018-05-16T10:05:17",  
  17.       "current_state": {  
  18.         "s_keyed_name""Preliminary",  
  19.         "s_type""State",  
  20.         "s_name""Preliminary",  
  21.         "y_text""551FC3BA62D54D80A075D14EAAA22561"  
  22.       },  
  23.       "generation""1",  
  24.       "has_change_pending""0",  
  25.       "has_files""1",  
  26.       "id": {  
  27.         "s_keyed_name""16002",  
  28.         "s_type""Document",  
  29.         "y_text""6D387DF8EA1F460C998F8D28D0FEC76C"  
  30.       },  
  31.       "is_current""1",  
  32.       "is_released""0",  
  33.       "is_template""0",  
  34.       "keyed_name""16002",  
  35.       "locked_by_id": {  
  36.         "s_keyed_name""User",  
  37.         "s_type""User",  
  38.         "y_text""2A5D1BF097F947AEA2BA2824293761FB"  
  39.       },  
  40.       "major_rev""A",  
  41.       "modified_by_id": {  
  42.         "s_keyed_name""PM1",  
  43.         "s_type""User",  
  44.         "y_text""D01240E9F0BB467587B27BC975AC88FC"  
  45.       },  
  46.       "modified_on""2018-05-16T10:05:17",  
  47.       "name""FCC2",  
  48.       "new_version""0",  
  49.       "not_lockable""0",  
  50.       "permission_id": {  
  51.         "s_keyed_name""Document 01",  
  52.         "s_type""Permission",  
  53.         "y_text""09ABED2EE11246E9875E3E083D91117E"  
  54.       },  
  55.       "state""Preliminary",  
  56.       "team_id": {  
  57.         "s_keyed_name""HD27",  
  58.         "s_type""Team",  
  59.         "y_text""D79F2DCD9A564DCCA235947A52C8A918"  
  60.       },  
  61.       "item_number""D-180516002",  
  62.       "itemtype""B88C14B99EF449828C5D926E39EE8B89",  
  63.       "Relationships": {  
  64.         "Item": {  
  65.           "s_type""Document File",  
  66.           "s_typeId""653C8EE5DDDF4932B75E5CDF04F0CD42",  
  67.           "s_id""315EE95ADC26472F9E1E1C2D759AE575",  
  68.           "behavior""float",  
  69.           "config_id": {  
  70.             "s_keyed_name""315EE95ADC26472F9E1E1C2D759AE575",  
  71.             "s_type""Document File",  
  72.             "y_text""315EE95ADC26472F9E1E1C2D759AE575"  
  73.           },  
  74.           "created_by_id": {  
  75.             "s_keyed_name""PM1",  
  76.             "s_type""User",  
  77.             "y_text""D01240E9F0BB467587B27BC975AC88FC"  
  78.           },  
  79.           "created_on""2018-05-16T10:05:17",  
  80.           "generation""1",  
  81.           "id": {  
  82.             "s_keyed_name""315EE95ADC26472F9E1E1C2D759AE575",  
  83.             "s_type""Document File",  
  84.             "y_text""315EE95ADC26472F9E1E1C2D759AE575"  
  85.           },  
  86.           "is_current""1",  
  87.           "is_released""0",  
  88.           "is_shared""1",  
  89.           "keyed_name""315EE95ADC26472F9E1E1C2D759AE575",  
  90.           "major_rev""A",  
  91.           "modified_by_id": {  
  92.             "s_keyed_name""PM1",  
  93.             "s_type""User",  
  94.             "y_text""D01240E9F0BB467587B27BC975AC88FC"  
  95.           },  
  96.           "modified_on""2018-05-16T10:05:17",  
  97.           "new_version""1",  
  98.           "not_lockable""0",  
  99.           "permission_id": {  
  100.             "s_keyed_name""Document 01",  
  101.             "s_type""Permission",  
  102.             "y_text""09ABED2EE11246E9875E3E083D91117E"  
  103.           },  
  104.           "related_id": {  
  105.             "s_keyed_name""test.doc",  
  106.             "s_type""File",  
  107.             "Item": {  
  108.               "s_type""File",  
  109.               "s_typeId""8052A558B9084D41B9F11805E464F443",  
  110.               "s_id""4BB93E1285BC40588EE318DFA0E46F66",  
  111.               "checkedout_path""",  
  112.               "checksum""5A1C65804B78C4D0019AAC406B61730A",  
  113.               "config_id": {  
  114.                 "s_keyed_name""test.doc",  
  115.                 "s_type""File",  
  116.                 "y_text""4BB93E1285BC40588EE318DFA0E46F66"  
  117.               },  
  118.               "created_by_id": {  
  119.                 "s_keyed_name""M1",  
  120.                 "s_type""User",  
  121.                 "y_text""D01240E9F0BB467587B27BC975AC88FC"  
  122.               },  
  123.               "created_on""2018-05-16T10:05:17",  
  124.               "current_state": {  
  125.                 "s_keyed_name""Released",  
  126.                 "s_type""State",  
  127.                 "s_name""Released",  
  128.                 "y_text""C363ABDADF8D485393BB89877DBDCFD0"  
  129.               },  
  130.               "file_size""53248",  
  131.               "file_type": {  
  132.                 "s_keyed_name""Microsoft Word 97-2003",  
  133.                 "s_type""FileType",  
  134.                 "y_text""642B5CDF908B483690B53CA654EB4892"  
  135.               },  
  136.               "generation""1",  
  137.               "id": {  
  138.                 "s_keyed_name""test.doc",  
  139.                 "s_type""File",  
  140.                 "y_text""4BB93E1285BC40588EE318DFA0E46F66"  
  141.               },  
  142.               "is_current""1",  
  143.               "is_released""1",  
  144.               "keyed_name""test.doc",  
  145.               "major_rev""A",  
  146.               "mimetype""application/msword",  
  147.               "modified_by_id": {  
  148.                 "s_keyed_name""as1",  
  149.                 "s_type""User",  
  150.                 "y_text""D01240E9F0BB467587B27BC975AC88FC"  
  151.               },  
  152.               "modified_on""2018-05-16T10:05:17",  
  153.               "new_version""1",  
  154.               "not_lockable""0",  
  155.               "permission_id": {  
  156.                 "s_keyed_name""File Restriction",  
  157.                 "s_type""Permission",  
  158.                 "y_text""3CA0FD33C589477397D2DBE1BDD855D4"  
  159.               },  
  160.               "state""Released",  
  161.               "filename""test.doc"  
  162.             }  
  163.           },  
  164.           "sort_order""1",  
  165.           "source_id": {  
  166.             "s_keyed_name""16002",  
  167.             "s_type""Document",  
  168.             "y_text""6D387DF8EA1F460C998F8D28D0FEC76C"  
  169.           },  
  170.           "team_id": {  
  171.             "s_keyed_name""HD27",  
  172.             "s_type""Team",  
  173.             "y_text""D79F2DCD9A564DCCA235947A52C8A918"  
  174.           },  
  175.           "itemtype""653C8EE5DDDF4932B75E5CDF04F0CD42"  
  176.         }  
  177.       }  
  178.     },  
error on : line 105
 
thanks.  
 

Answers (1)