Skip to content

Commit 85d92f3

Browse files
committed
Added Country name functions by haseeb-heaven
1 parent 02b4a1a commit 85d92f3

35 files changed

+94
-21
lines changed
5 KB
Binary file not shown.
-512 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

CovidSharp Example/CovidSharp Example/Program.cs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,21 @@ static void Main(string[] args)
1717
Console.WriteLine("Recovered: " + data.LatestRecovered());
1818
Console.WriteLine("Deaths: " + data.LatestDeaths());
1919

20-
21-
Console.WriteLine("Denmark Confirmed: " + data.FromCountryConfirmed("DK"));
22-
Console.WriteLine("Denmark Recovered: " + data.FromCountryRecovered("DK"));
23-
Console.WriteLine("Denmark Deaths: " + data.FromCountryDeaths("DK"));
2420

25-
Console.WriteLine("Denmark ID Confirmed: " + data.FromIDConfirmed("94"));
26-
Console.WriteLine("Denmark ID Recovered: " + data.FromCountryRecovered("94"));
27-
Console.WriteLine("Denmark ID Deaths: " + data.FromCountryDeaths("94"));
21+
// Fetches the latest data of a country code.
22+
string country_code = "DK";
23+
Console.WriteLine("Denmark Confirmed: " + data.FromCountryCodeConfirmed(country_code));
24+
Console.WriteLine("Denmark Recovered: " + data.FromCountryCodeRecovered(country_code));
25+
Console.WriteLine("Denmark Deaths: " + data.FromCountryCodeDeaths(country_code));
26+
27+
// Fetches the latest data of a country Name.
28+
string country_name = "China";
29+
Console.WriteLine("China Confirmed: " + data.FromCountryNameConfirmed(country_name));
30+
Console.WriteLine("China Recovered: " + data.FromCountryNameRecovered(country_name));
31+
Console.WriteLine("China Deaths: " + data.FromCountryNameDeaths(country_name));
32+
Console.ReadLine();
2833

34+
//Fetches the data of the Country/province associated with the ID
2935
Console.WriteLine("Name of the Faroe Islands: " + data.FromIDProvince("92"));
3036
Console.WriteLine("Name of the country of the Faroe Islands: " + data.FromIDCountry("92"));
3137

Binary file not shown.
Binary file not shown.
512 Bytes
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)