Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

how to read json { "empdata": { "emp": [ { "DATE": "07.01.2021", "EMP_ID": "A001", "S_DATE": "2021-01-07T00:00:00.000+00:00", "Desig": "Engg" }, { "DATE": "08.01.2021", "EMP_ID": "A002", "S_DATE": "2021-01-07T00:00:00.000+00:00", "Desig": "Engg" } ] } } in c#

question from:https://stackoverflow.com/questions/66062639/c-sharp-json-arrary-reading

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
132 views
Welcome To Ask or Share your Answers For Others

1 Answer

//Create Class First

public class Emp    {
    public string DATE { get; set; } 
    public string EMP_ID { get; set; } 
    public DateTime S_DATE { get; set; } 
    public string Desig { get; set; } 
}

public class Empdata    {
    public List<Emp> emp { get; set; } 
}

public class Data{
    public Empdata empdata { get; set; } 
}

string JsonResponse="Your Json Data";

Data JsonData= JsonConvert.DeserializeObject(JsonResponse);

JsonData Will Have all of Ur Data


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...