第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用鍵將嵌套的 JObject 反序列化為 List

使用鍵將嵌套的 JObject 反序列化為 List

C#
函數(shù)式編程 2021-06-04 10:37:28
我需要使用 Newtonsoft.Json 將 json 反序列化回對象實例。但是,它是一個列表類型對象,條目的鍵對我很有用。我不知道如何在不手動一一映射字段的情況下自動反序列化。這是回應(yīng):{    coins: {        365Coin: {            id: 74,            tag: "365",            algorithm: "Keccak",            lagging: true,            listed: false,            status: "No available stats",            testing: false        },        Aiden: {            id: 65,            tag: "ADN",            algorithm: "Scrypt-OG",            lagging: true,            listed: false,            status: "No available stats",            testing: false        },        Adzcoin: {            id: 157,            tag: "ADZ",            algorithm: "X11",            lagging: false,            listed: false,            status: "Active",            testing: false        }        ... [With various key representing the name of coins]    }}完整回復(fù):https : //whattomine.com/calculators.json我對這門課的最佳猜測是:internal class WhatToMineCalculatorsResponse{    // Should be Dictionary???    [JsonProperty("coins")]    public IList<WhatToMineCalculatorResponse> Coins { get; set; }}internal class WhatToMineCalculatorResponse{    // I want the key set in this field    public string Name { get; set; }    [JsonProperty("id")]    public int Id { get; set; }    [JsonProperty("tag")]    public string Symbol { get; set; }    [JsonProperty("status")]    public string Status { get; set; }    [JsonProperty("algorithm")]    public string Algo { get; set; }    [JsonProperty("listed")]    public bool IsListed { get; set; }}請注意,我希望將鍵包含在我的類中,但不希望作為字典的鍵。以后很難找回密鑰。
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 569 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號