Skip to content

Commit 9ec04b2

Browse files
committed
fixed bug
1 parent 1684f0f commit 9ec04b2

File tree

13 files changed

+9
-28
lines changed

13 files changed

+9
-28
lines changed
0 Bytes
Binary file not shown.

CovidSharp/.vs/CovidSharp/v15/.suo

7 KB
Binary file not shown.
0 Bytes
Binary file not shown.
865 KB
Binary file not shown.

CovidSharp/Class1.cs

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,8 @@ public string FromCountryConfirmed(string country)
7171
//Deserializes the response
7272
JObject output = (JObject)JsonConvert.DeserializeObject(response.Content);
7373

74-
//Stores the 'locations' node in the locations variable
75-
var locations = output["locations"];
76-
77-
//Stores the 'id' sub node of the 'locations' node in the IdInfo variable
78-
var IdInfo = locations[0];
79-
80-
//Stores the 'latest' sub node of the 'id' sub node in the LatestData variable
81-
var LatestData = IdInfo["latest"];
74+
//Stores the 'latest' node in the LatestData variable
75+
var LatestData = output["latest"];
8276

8377
//The 'confirmed' sub node of the 'latest' sub node is fetched and converted into a string
8478
var CountryConfirmedData = LatestData["confirmed"].ToString();
@@ -96,16 +90,10 @@ public string FromCountryRecovered(string country)
9690
//Deserializes the response
9791
JObject output = (JObject)JsonConvert.DeserializeObject(response.Content);
9892

99-
//Stores the 'locations' node in the locations variable
100-
var locations = output["locations"];
101-
102-
//Stores the 'id' sub node of the 'locations' node in the IdInfo variable
103-
var IdInfo = locations[0];
104-
105-
//Stores the 'latest' sub node of the 'id' sub node in the LatestData variable
106-
var LatestData = IdInfo["latest"];
93+
//Stores the 'latest' node in the LatestData variable
94+
var LatestData = output["latest"];
10795

108-
//The 'confirmed' sub node of the 'latest' sub node is fetched and converted into a string
96+
//The 'recovered' sub node of the 'latest' sub node is fetched and converted into a string
10997
var CountryRecoveredData = LatestData["recovered"].ToString();
11098
return CountryRecoveredData;
11199
}
@@ -121,16 +109,10 @@ public string FromCountryDeaths(string country)
121109
//Deserializes the response
122110
JObject output = (JObject)JsonConvert.DeserializeObject(response.Content);
123111

124-
//Stores the 'locations' node in the locations variable
125-
var locations = output["locations"];
126-
127-
//Stores the 'id' sub node of the 'locations' node in the IdInfo variable
128-
var IdInfo = locations[0];
129-
130-
//Stores the 'latest' sub node of the 'id' sub node in the LatestData variable
131-
var LatestData = IdInfo["latest"];
132-
133-
//The 'confirmed' sub node of the 'latest' sub node is fetched and converted into a string
112+
//Stores the 'latest' node in the LatestData variable
113+
var LatestData = output["latest"];
114+
115+
//The 'Deaths' sub node of the 'latest' sub node is fetched and converted into a string
134116
var CountryDeathsData = LatestData["deaths"].ToString();
135117
return CountryDeathsData;
136118
}

CovidSharp/CovidSharp.v11.suo

-15 KB
Binary file not shown.
0 Bytes
Binary file not shown.
-2 KB
Binary file not shown.

CovidSharp/obj/Debug/CovidSharp.csproj.FileListAbsolute.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ C:\Users\Abdirahiim\source\repos\CovidSharp - Github\CovidSharp\bin\Debug\Newton
44
C:\Users\Abdirahiim\source\repos\CovidSharp - Github\CovidSharp\bin\Debug\RestSharp.dll
55
C:\Users\Abdirahiim\source\repos\CovidSharp - Github\CovidSharp\bin\Debug\Newtonsoft.Json.xml
66
C:\Users\Abdirahiim\source\repos\CovidSharp - Github\CovidSharp\bin\Debug\RestSharp.xml
7-
C:\Users\Abdirahiim\source\repos\CovidSharp - Github\CovidSharp\obj\Debug\CovidSharp.csprojAssemblyReference.cache
87
C:\Users\Abdirahiim\source\repos\CovidSharp - Github\CovidSharp\obj\Debug\CovidSharp.csproj.CoreCompileInputs.cache
98
C:\Users\Abdirahiim\source\repos\CovidSharp - Github\CovidSharp\obj\Debug\CovidSharp.csproj.CopyComplete
109
C:\Users\Abdirahiim\source\repos\CovidSharp - Github\CovidSharp\obj\Debug\CovidSharp.dll
-58.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)