[ad_1]
I’am trying to deserialize parts of Json that is in my file. I’m using xy.json file in my project.
THIS IS MY JSON FILE:
[{"id":1,"letter":"A","ordered_teams":[{"id":1,"country":"France","alternate_name":null,"fifa_code":"FRA","group_id":1,"group_letter":"A","wins":4,"draws":0,"losses":1,"games_played":5,"points":12,"goals_for":10,"goals_against":4,"goal_differential":6},{"id":3,"country":"Norway"
i have 2 classes generetad by quicktype
this is my data.class
[JsonProperty("id")]
public long Id { get; set; }
[JsonProperty("letter")]
public string Letter { get; set; }
[JsonProperty("ordered_teams")]
public List<Team> OrderedTeams { get; set; }
I am trying to get the List of orderedTeams
data podatci = JsonConvert.DeserializeObject<data>(json)
and return data.OrderedTeams
;
But I’m getting null reference.
Don’t know what I’m doing wrong
[ad_2]