Skip to content

Commit a305405

Browse files
committed
Changing GetCountriesByPhoneCode method name to GetCountryByPhoneCode
1 parent 0f340b9 commit a305405

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ A simple cross-platform offline .NET library for getting Global Country Data wit
3636

3737
This production-grade package can be used with .NET Core Webapi, .NET console applications, .NET Maui, Xamarin, Blazor, and mobile apps. It is compatible with both .NET Core and .NET Framework projects.
3838

39-
For detailed instructions on how to use the library, please refer to our [documentation](../CountryData.Net/docs/README.md).
39+
For detailed instructions on how to use the library, please refer to our [documentation](./docs/README.md ).
4040

4141
For a quick start, you can check out the `Simple code` folder provided in the repository.
4242

sample/CountryData.Sample.Console/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ static void GetPhoneCodeByCountryShortCode(string shortCode)
105105
/// <param name="phoneCode">The phone code.</param>
106106
static void GetCountryByPhoneCode(string phoneCode)
107107
{
108-
var countries = _helper.GetCountriesByPhoneCode(phoneCode);
109-
Console.WriteLine($"Countries for phone code {phoneCode}:");
108+
var countries = _helper.GetCountryByPhoneCode(phoneCode);
109+
Console.WriteLine($"Country for phone code {phoneCode}:");
110110
foreach (var country in countries)
111111
{
112112
Console.WriteLine(country.CountryName);

sample/CountryData.Sample.Web.API/Controllers/CountryController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public IActionResult GetPhoneCodeByCountryShortCode([FromQuery] string countryCo
144144
[ProducesResponseType(404)]
145145
public IActionResult GetCountryByPhoneCode([FromQuery] string phoneCode)
146146
{
147-
var countryDataByPhoneCode = _helper.GetCountriesByPhoneCode(phoneCode);
147+
var countryDataByPhoneCode = _helper.GetCountryByPhoneCode(phoneCode);
148148
if (countryDataByPhoneCode == null)
149149
{
150150
return NotFound();

src/CountryData.Standard/CountryHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ public string GetPhoneCodeByCountryShortCode(string shortCode)
111111
/// </summary>
112112
/// <param name="phoneCode"></param>
113113
/// <returns>Country</returns>
114-
public IEnumerable<Country> GetCountriesByPhoneCode(string phoneCode)
114+
public IEnumerable<Country> GetCountryByPhoneCode(string phoneCode)
115115
{
116-
var countries = _Countries.Where(c => c.PhoneCode == phoneCode);
117-
return countries;
116+
var Country = _Countries.Where(c => c.PhoneCode == phoneCode);
117+
return Country;
118118
}
119119

120120

test/CountryData.UnitTests/CountryHelperTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public void GetPhoneCodeByCountryShortCode_WithCorrectShortCode_ShouldReturnPhon
121121
public void GetCountriesByPhoneCode_WithCorrectPhoneCode_ShouldReturnCountries(string phoneCode, string expectedShortCode)
122122
{
123123
//Act
124-
var countries = _countryHelper.GetCountriesByPhoneCode(phoneCode);
124+
var countries = _countryHelper.GetCountryByPhoneCode(phoneCode);
125125

126126
//Assert
127127
countries.Should().NotBeNullOrEmpty();

0 commit comments

Comments
 (0)