hi,
I can read json. For example json
{
“api”: {
“results”: 4,
“fixtures”: {
“1757”: {
“fixture_id”: “1757”,
“event_timestamp”: “1532565900”,
“league_id”: “6”,
“round”: “Serie A - 15”,
“homeTeam_id”: “131”,
“awayTeam_id”: “135”,
“homeTeam”: “Corinthians”,
“awayTeam”: “Cruzeiro”,
“status”: “Match Finished”,
“goalsHomeTeam”: “2”,
“goalsAwayTeam”: “0”,
“elapsed”: “0”,
“firstHalfStart”: “0”,
“secondHalfStart”: “0”
},
“1758”: {
“fixture_id”: “1758”,
“event_timestamp”: “1532565900”,
“league_id”: “6”,
“round”: “Serie A - 15”,
“homeTeam_id”: “128”,
“awayTeam_id”: “127”,
“homeTeam”: “Santos”,
“awayTeam”: “Flamengo”,
“status”: “Match Finished”,
“goalsHomeTeam”: “1”,
“goalsAwayTeam”: “1”,
“elapsed”: “0”,
“firstHalfStart”: “1532611202”,
“secondHalfStart”: “0”
},
“1759”: {
“fixture_id”: “1759”,
“event_timestamp”: “1532563200”,
“league_id”: “6”,
“round”: “Serie A - 15”,
“homeTeam_id”: “117”,
“awayTeam_id”: “122”,
“homeTeam”: “Atletico Mineiro”,
“awayTeam”: “Parana”,
“status”: “Match Finished”,
“goalsHomeTeam”: “2”,
“goalsAwayTeam”: “0”,
“elapsed”: “0”,
“firstHalfStart”: “0”,
“secondHalfStart”: “0”
},
“1760”: {
“fixture_id”: “1760”,
“event_timestamp”: “1532557800”,
“league_id”: “6”,
“round”: “Serie A - 15”,
“homeTeam_id”: “124”,
“awayTeam_id”: “121”,
“homeTeam”: “Fluminense”,
“awayTeam”: “Palmeiras”,
“status”: “Match Finished”,
“goalsHomeTeam”: “1”,
“goalsAwayTeam”: “0”,
“elapsed”: “0”,
“firstHalfStart”: “0”,
“secondHalfStart”: “0”
}
}
}
}
But I can not create Serialization class. Because some places are dynamic numbers. If you has a class structure example, please share with me. Can you help me ?
Join in the discussion - add comment below:
Ok cool
I founded solution.
HttpClient tarayici = new HttpClient();
var responseText = streamReader.ReadToEnd();
responseText = responseText.ToString().Replace(""", “’”);
JObject googleSearch = JObject.Parse(responseText);
and others…
thanks.
Ok. I changed.
Hi,
Please edit your comment, your API KEY is visible !
hello, dynamic numbers is fixture_id at the beginning of a sentence. For example I need convert json to class for insert database. Do you have example class ?
My code is ;
public class RootObject3
public void al()
{
thanks
hello,
dynamic numbers is fixture_id at the beginning of a sentence. For example
I need convert json to class for insert database. Do you have example class ?
My code is ;
HttpClient tarayici = new HttpClient();
public class RootObject3
{
public string fixture_id { get; set; }
public string event_timestamp { get; set; }
public string league_id { get; set; }
public string round { get; set; }
public string homeTeam_id { get; set; }
public string awayTeam_id { get; set; }
public string homeTeam { get; set; }
public string awayTeam { get; set; }
public string status { get; set; }
public string goalsHomeTeam { get; set; }
public string goalsAwayTeam { get; set; }
public string elapsed { get; set; }
public string firstHalfStart { get; set; }
public string secondHalfStart { get; set; }
}
Thanks
Hello,
what are you trying to do exactly?
For example :
1757 : is the ID of the matche (it is unique)
“fixtures”: { “1757”: { “fixture_id”: “1757”, “event_timestamp”: “1532565900”, “league_id”: “6”, “round”: “Serie A - 15”, “homeTeam_id”: “131”, “awayTeam_id”: “135”, “homeTeam”: “Corinthians”, “awayTeam”: “Cruzeiro”, “status”: “Match Finished”, “goalsHomeTeam”: “2”, “goalsAwayTeam”: “0”, “elapsed”: “0”, “firstHalfStart”: “0”, “secondHalfStart”: “0” },
What are the “dynamic numbers” ?
For betters support contact us at : apifootball.contact@gmail.com