File tree Expand file tree Collapse file tree
sample/CountryData.Sample.Blazor/Components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 <thead >
1919 <tr >
2020 <th >Name </th >
21+ <th >Flag </th >
2122 <th >Country Short Code </th >
2223 <th >Phone Code </th >
2324 </tr >
2728 {
2829 <tr >
2930 <td >@country.CountryName </td >
31+ <td >@GrtCountryFlag(country.CountryShortCode) </td >
3032 <td >@country.CountryShortCode </td >
3133 <td >@country.PhoneCode </td >
3234 </tr >
4850 {
4951 countries = await CountryService .GetCountries ();
5052 }
53+
54+
55+
56+ // getting counry flag
57+
58+ public string GrtCountryFlag (string countryShortCode )
59+ {
60+ return CountryService .GetCountryFlag (countryShortCode );
61+ }
62+
5163}
Original file line number Diff line number Diff line change @@ -25,16 +25,17 @@ public CountryService(CountryHelper helper)
2525 /// <param name="countryCode">The country code.</param>
2626 /// <returns>The country flag as a string.</returns>
2727
28- public Task < string > GetCountryFlag ( string countryCode )
28+ public string GetCountryFlag ( string countryCode )
2929 {
3030 var countryFlag = _helper . GetCountryEmojiFlag ( countryCode ) ;
3131
3232 if ( string . IsNullOrEmpty ( countryFlag ) )
3333 {
34- return Task . FromResult ( "Country Flag not found" ) ;
34+
35+ return "No flag found" ;
3536 }
3637
37- return Task . FromResult ( countryFlag ) ;
38+ return countryFlag ;
3839 }
3940
4041
You can’t perform that action at this time.
0 commit comments