public DeserializeMatches deserialize() { var url = string.Format("http://localhost:53766/api/Match/"); // Syncronious Consumption var syncClient = new WebClient(); var content = syncClient.DownloadString(url); DeserializeMatches matches = JsonConvert.DeserializeObject <DeserializeMatches>(content); return(matches); }
public Match deserialize(string id) { var url = string.Format("http://localhost:53766/api/Match/"); // Syncronious Consumption var syncClient = new WebClient(); var content = syncClient.DownloadString(url); DeserializeMatches matches = JsonConvert.DeserializeObject <DeserializeMatches>(content); var match = matches.Matches.Where(x => x.Id == id).FirstOrDefault(); return(match); }