2017-03-17 5 views
0

json文字列を以下の例のそれぞれのクラスモデルに変換する方法。次のjson文字列のC#クラスモデルを作成するには?

クラスモデル「1」にJSONのインデックスの変換のためにクラスモデル"1": {

{ 
    "caller_audio": { 
     "errors": [], 
     "lattice": { 
      "1": { 
       "links": { 
        "0": { 
         "start": 0, 
         "end": 0.44, 
         "weight": 0, 
         "word_confidence": 0.974111, 
         "best_path": true, 
         "word": "!ENTER", 
         "intensity": 0 
        } 
       } 
      } 
     } 
    } 
} 

答えて

0

にJSONのインデックスの変換する方法を教えてください:{のIListを使用する必要があります。

public class LatticeModel 
{ 
    public IList<LinksModel> Links { get; set; } 
} 
public class LinksItemModel 
{ 
    public string start { get; set; } 

    public string end { get; set; } 

    public string weight { get; set; } 

    public string word_confidence { get; set; } 

    public string best_path { get; set; } 

    public string word { get; set; } 

    public string intensity { get; set; } 

} 

public class LinksModel 
{ 

    public IList<LinksItemModel> links { get; set; } 
} 
関連する問題