Home > Net >  Josn deserialize a row of data in a more josn format attributes, how deserialization
Josn deserialize a row of data in a more josn format attributes, how deserialization

Time:10-27

[\r\n {\r\n "componentType": "TextField",\r\n "label": "单号",\r\n "value": "DCN-201353A",\r\n "key": "TextField-KCK07MWI"\r\n },\r\n {\r\n "componentType": "InnerContactField",\r\n "label": "员工姓名",\r\n "extendValue": [\r\n {\r\n "emplId": "101693",\r\n "name": "郭花英",\r\n "avatar": ""\r\n }\r\n ],\r\n "value": "郭花英",\r\n "key": "InnerContactField-KCK07MWJ"\r\n },\r\n {\r\n "componentType": "NumberField",\r\n "label": "工时",\r\n "value": "2",\r\n "key": "NumberField-KCK07MWL"\r\n }\r\n]

Josn above employee name this row data much extendValue attribute, this property is Josn format, how to deserialize

CodePudding user response:

Is not a json as a whole? What's special?

CodePudding user response:

Single number and working hour is only the pop3access.componenttype, label, the value of three attributes, the pop3access.componenttype employee name, label, value, extendValue four properties, is also the extendValue attribute the Josn format, if within the class defines extendValue this property, the transformation error when the

CodePudding user response:

Defined as attribute collection, according to the pop3access.componenttype decision into which a

Or is not defined, the series into a dynamic object

CodePudding user response:

According to the column of recycling and transformation can be, but is there a way to can ignore no extendValue attribute transformation is not an error?

CodePudding user response:

There is a stupid way to not think don't abandon ha , to build a vm properties that are in the original plus a extendValue attribute, on the basis of this serialization is not an error! Another way is to JObject, from JObject values inside the

CodePudding user response:

[JsonIgnore] on extendValue attributes
  •  Tags:  
  • C#
  • Related