diff --git a/sample/CountryData.Sample.Blazor/Components/Pages/Home.razor b/sample/CountryData.Sample.Blazor/Components/Pages/Home.razor index 66cb6ca..c2f4468 100644 --- a/sample/CountryData.Sample.Blazor/Components/Pages/Home.razor +++ b/sample/CountryData.Sample.Blazor/Components/Pages/Home.razor @@ -18,6 +18,7 @@ else Name + Flag Country Short Code Phone Code @@ -27,6 +28,7 @@ else { @country.CountryName + @GrtCountryFlag(country.CountryShortCode) @country.CountryShortCode @country.PhoneCode @@ -48,4 +50,14 @@ else { countries = await CountryService.GetCountries(); } + + + + // getting counry flag + + public string GrtCountryFlag(string countryShortCode) + { + return CountryService.GetCountryFlag(countryShortCode); + } + } diff --git a/sample/CountryData.Sample.Blazor/Components/Services/CountryService.cs b/sample/CountryData.Sample.Blazor/Components/Services/CountryService.cs index 07ff3bd..9cd1da3 100644 --- a/sample/CountryData.Sample.Blazor/Components/Services/CountryService.cs +++ b/sample/CountryData.Sample.Blazor/Components/Services/CountryService.cs @@ -25,16 +25,17 @@ public CountryService(CountryHelper helper) /// The country code. /// The country flag as a string. - public Task GetCountryFlag(string countryCode) + public string GetCountryFlag(string countryCode) { var countryFlag = _helper.GetCountryEmojiFlag(countryCode); if (string.IsNullOrEmpty(countryFlag)) { - return Task.FromResult("Country Flag not found"); + + return "No flag found"; } - return Task.FromResult(countryFlag); + return countryFlag; }