Skip to content

Commit 10fa053

Browse files
committed
Update getCountry to return single country Item
1 parent 3a23e5b commit 10fa053

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

CountryHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ public IEnumerable<Country> GetCountryData()
4444

4545

4646
/// <summary>
47-
/// Returns Country Data by ShortCode
47+
/// Returns a single Country Data by ShortCode
4848
/// </summary>
4949
/// <param name="ShortCode"></param>
50-
/// <returns>IEnumerable<Country></returns>
51-
public IEnumerable<Country> GetCountry(string ShortCode)
50+
/// <returns>Country</returns>
51+
public Country GetCountryByCode(string ShortCode)
5252
{
53-
return _Countries.Where(x => x.CountryShortCode == ShortCode);
53+
return _Countries.SingleOrDefault(c => c.CountryShortCode == ShortCode);
5454
}
5555

5656

0 commit comments

Comments
 (0)