我的結(jié)果集中包含一個(gè) id 字段,該字段來(lái)自我存儲(chǔ)為動(dòng)態(tài)對(duì)象的 Web 響應(yīng)。{ "filterFields": [ { "connectionName": "metis_dev", "querySourceCategoryName": "dbo", "sourceFieldName": "DealerGroupId", "sourceFieldVisible": true, "sourceFieldFilterable": true, "sourceDataObjectName": "Dealers", "sourceDataObjectFullName": "metis_dev.dbo.Dealers", "querySourceName": "Dealers", "dataType": "Numeric", "isParameter": false, "isCalculated": false, "calculatedTree": null, "compareFieldCalculatedTree": null, "compareValueCalculatedTree": null, "compareField": null, "selected": false, "dataFormat": null, "reportId": null, "useMappedFieldAlias": false, "uniqueId": null, "comparisionValue": null, "inTimePeriodType": null, "valueInTimePeriod": null, "hasModifiedCalculatedTree": false, "isHiddenFilter": false, "isInheritableFilter": false, "isOveridingInheritedFilter": false, "operatorName": "Equals (Manual Entry No Auto-Complete)", "type": 0, "isRunningField": false, "isCompositeField": false, "isDrillDown": false, "originalDataType": null, "isReGroupField": false, "filterId": "3ab260ff-6894-4f23-ab78-5b4db43ae65e", "reportFieldAlias": null, "reportPartTitle": null, "querySourceFieldId": "d313dc65-3d63-4682-8c80-6ab0f235b1d7", "querySourceType": "Table", "querySourceId": "ac13435a-98b1-4ea9-97af-815b67842334", "relationshipId": null, "alias": "DealerGroupId", "position": 1, "visible": true, "required": false, "cascading": true, "operatorId": "5b654e75-d293-4e7e-9102-cdb74286e717", "operatorSetting": null, "value": "4967", "dataFormatId": null, } ]}當(dāng)我在運(yùn)行時(shí)將鼠標(biāo)懸停在根對(duì)象上時(shí),其中一個(gè)值就是上面的filterFields對(duì)象。但是當(dāng)我說(shuō) 時(shí)foreach(var filterField in root.filterFields),我會(huì)得到一個(gè)錯(cuò)誤,因?yàn)閒ilterField結(jié)果中不存在。我應(yīng)該如何訪問(wèn)該filterFields集合以便獲得我正在尋找的“id”屬性?我想filterFields從結(jié)果中循環(huán),但我現(xiàn)在無(wú)法做到。
從網(wǎng)絡(luò)響應(yīng)中迭代動(dòng)態(tài)對(duì)象
HUH函數(shù)
2023-07-22 16:54:31