![](/img/trans.png)
[英]how to read an HDF5 multi-dimensional array dataset using HDF5DotNet from C# .net?
[英]How to read from Multi-Dimensional dictionary C#
我正在嘗試找出一種更好的方法來處理我在這里遇到的這個對象/字典難題。
基本上,我會得到一個JSON iResponse(非常清晰)並反序列化為Dictionary。 那很好,但是我得到了一個龐大的字典,其中也包含對象以及可能還有更多的字典? 我有點困惑。
這是我的代碼,可將響應放入字典中:
var TicketInfo = jss.Deserialize<Dictionary<dynamic, dynamic>>(ticketExistsJSON.Content);
這是我在控制台中得到的:
所以這在我的JiraTicketInfo變量中。 您可以看到其完整的鍵值對,但在這些鍵值對的值內還有另一本詞典? 在這本詞典中包含了我想要的鍵值對。 我特別只想要數字1。
我找到了一種方法
字典JiraTicketInfo = TicketInfo [“ issues”] [0] [“ fields”];
var bumStatus =(object [])JiraTicketInfo [“ customfield_10004”];
var numStatusDict =(Dictionary)bumStatus [0];
JiraOrg = numStatusDict [“ name”]。ToString();
但是我覺得有一種更簡單的方法來獲得它,但是我的大腦似乎無法理解多維詞典
任何幫助將非常感激!
我什至沒有在尋找答案,只是在哪里找到答案。 謝謝 :)
這是我的JSON響應:
{ "expand": "names,schema", "startAt": 0, "maxResults": 1, "total": 1, "issues": [ { "expand": "customfield_10087.properties,operations,versionedRepresentations,editmeta,changelog,renderedFields", "id": "18293", "self": "https://www.myjirahost.com/rest/api/2/issue/18293", "key": "SS-2991", "fields": { "customfield_10070": null, "customfield_10071": null, "customfield_10072": null, "customfield_10073": null, "customfield_10074": null, "customfield_10075": null, "customfield_10089": null, "customfield_10004": [ { "id": "99", "name": "Organization Name B", "_links": { "self": "https://www.myjirahost.com/rest/servicedeskapi/organization/99" } } ], "environment": null, "duedate": null } } ] }
在所有人的幫助下使用resttosharp網站解決了問題並建立了課程:
RootObject JiraIssueObj = JsonConvert.DeserializeObject(ticketExistsJSON.Content);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.