Skip to content

Commit cd3c764

Browse files
authored
Merge branch 'master' into master
2 parents 478081e + 97c8232 commit cd3c764

38 files changed

+2616
-59
lines changed
51 KB
Loading

Assets/CountryData.Net.Logo.png

82.9 KB
Loading

Assets/logo.png

-26.4 KB
Binary file not shown.

CountryData.Standard.sln

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{131F8946-782
3131
EndProject
3232
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{3803AB02-5C70-4523-AA4E-8BEE9AD6D592}"
3333
EndProject
34-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CountryData.Sample.Web.API", "sample\CountryData.Sample.Web.API\CountryData.Sample.Web.API.csproj", "{787E809D-2E54-47F0-A5CB-8C0D383D327E}"
35-
EndProject
3634
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CountryData.Sample.MAUI", "sample\CountryData.Sample.MAUI\CountryData.Sample.MAUI\CountryData.Sample.MAUI.csproj", "{2EBA3AC1-C3FE-47B0-8606-917BA212E6AB}"
3735
EndProject
36+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CountryData.Sample.Web.API", "sample\CountryData.Sample.Web.API\CountryData.Sample.Web.API.csproj", "{A77E8CA8-11B9-41B4-A00C-46BD55756CF5}"
37+
EndProject
38+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CountryData.Sample.Blazor", "sample\CountryData.Sample.Blazor\CountryData.Sample.Blazor.csproj", "{6820CA38-0AB5-4532-9A26-DE9533BA2538}"
39+
EndProject
3840
Global
3941
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4042
Debug|Any CPU = Debug|Any CPU
@@ -53,16 +55,20 @@ Global
5355
{397666FE-700B-446E-B4EC-13ACF0DDDEBE}.Debug|Any CPU.Build.0 = Debug|Any CPU
5456
{397666FE-700B-446E-B4EC-13ACF0DDDEBE}.Release|Any CPU.ActiveCfg = Release|Any CPU
5557
{397666FE-700B-446E-B4EC-13ACF0DDDEBE}.Release|Any CPU.Build.0 = Release|Any CPU
56-
{787E809D-2E54-47F0-A5CB-8C0D383D327E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57-
{787E809D-2E54-47F0-A5CB-8C0D383D327E}.Debug|Any CPU.Build.0 = Debug|Any CPU
58-
{787E809D-2E54-47F0-A5CB-8C0D383D327E}.Release|Any CPU.ActiveCfg = Release|Any CPU
59-
{787E809D-2E54-47F0-A5CB-8C0D383D327E}.Release|Any CPU.Build.0 = Release|Any CPU
6058
{2EBA3AC1-C3FE-47B0-8606-917BA212E6AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6159
{2EBA3AC1-C3FE-47B0-8606-917BA212E6AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
6260
{2EBA3AC1-C3FE-47B0-8606-917BA212E6AB}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
6361
{2EBA3AC1-C3FE-47B0-8606-917BA212E6AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
6462
{2EBA3AC1-C3FE-47B0-8606-917BA212E6AB}.Release|Any CPU.Build.0 = Release|Any CPU
6563
{2EBA3AC1-C3FE-47B0-8606-917BA212E6AB}.Release|Any CPU.Deploy.0 = Release|Any CPU
64+
{A77E8CA8-11B9-41B4-A00C-46BD55756CF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
65+
{A77E8CA8-11B9-41B4-A00C-46BD55756CF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
66+
{A77E8CA8-11B9-41B4-A00C-46BD55756CF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
67+
{A77E8CA8-11B9-41B4-A00C-46BD55756CF5}.Release|Any CPU.Build.0 = Release|Any CPU
68+
{6820CA38-0AB5-4532-9A26-DE9533BA2538}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
69+
{6820CA38-0AB5-4532-9A26-DE9533BA2538}.Debug|Any CPU.Build.0 = Debug|Any CPU
70+
{6820CA38-0AB5-4532-9A26-DE9533BA2538}.Release|Any CPU.ActiveCfg = Release|Any CPU
71+
{6820CA38-0AB5-4532-9A26-DE9533BA2538}.Release|Any CPU.Build.0 = Release|Any CPU
6672
EndGlobalSection
6773
GlobalSection(SolutionProperties) = preSolution
6874
HideSolutionNode = FALSE
@@ -71,8 +77,9 @@ Global
7177
{BFFCBBCD-4DD4-4EBE-8282-A4694E6A0ECA} = {EBEF4582-3E32-4FBA-92CA-335DD47C2B4B}
7278
{A450767F-7970-4A30-834E-3E086B87D925} = {420B8450-0A31-431D-90B0-A5C9C7B314C9}
7379
{397666FE-700B-446E-B4EC-13ACF0DDDEBE} = {BBA69DE8-BE26-498E-9A62-131EB2494972}
74-
{787E809D-2E54-47F0-A5CB-8C0D383D327E} = {BBA69DE8-BE26-498E-9A62-131EB2494972}
7580
{2EBA3AC1-C3FE-47B0-8606-917BA212E6AB} = {BBA69DE8-BE26-498E-9A62-131EB2494972}
81+
{A77E8CA8-11B9-41B4-A00C-46BD55756CF5} = {BBA69DE8-BE26-498E-9A62-131EB2494972}
82+
{6820CA38-0AB5-4532-9A26-DE9533BA2538} = {BBA69DE8-BE26-498E-9A62-131EB2494972}
7683
EndGlobalSection
7784
GlobalSection(ExtensibilityGlobals) = postSolution
7885
SolutionGuid = {CD61C5EF-9299-42A8-81E2-D96FAF1BC81D}

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11

2-
# :earth_africa: CountryData.Net
3-
[![Gitter](https://badges.gitter.im/CountryDataDotnet/community.svg)](https://gitter.im/CountryDataDotnet/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
4-
A simple cross-platform offline .NET library for getting Global Country Data without making any HTTP calls.
2+
<!-- logo -->
53

4+
<img src="./Assets/CountryData.Net.Logo.Small.png" alt="Logo" width="250" height="200"/>
5+
6+
A cross-platform library designed to provide seamless access to global country data for .NET applications without making any http calls.
7+
Our aim is to simplify the process of integrating standardised global data into your applications, making it an ideal tool for developers who require international data.
8+
9+
### Project Status
610

711
| | |
812
|-|-|
@@ -20,6 +24,7 @@ A simple cross-platform offline .NET library for getting Global Country Data wit
2024
- 🗺️ Get country region by ISO 3166 country code
2125
- ☎️ Get country phone code by ISO 3166 country code
2226

27+
2328
### Install Library
2429
##### Package Manager
2530
```cSharp
@@ -42,6 +47,26 @@ For more detailed instructions and comprehensive information about the library,
4247

4348

4449

50+
51+
### Methods and Descriptions
52+
53+
The CountryData.Standard library provides a set of methods that allow you to retrieve country data, flags, regions, and phone codes. The following table lists the available methods and their descriptions.
54+
55+
| Method | Description |
56+
|--------|-------------|
57+
| [`GetCountryData()`](./docs/README.md) | Returns all country data including region, short code, and country name. |
58+
| [`GetCountryByCode(string shortCode)`](./docs/README.md) | Returns a single country's data by its short code. |
59+
| [`GetCountryEmojiFlag(string shortCode)`](./docs/README.md) | Gets the flag of the country, represented as an emoji, by the country's short code. |
60+
| [`GetRegionByCountryCode(string shortCode)`](./docs/README.md) | Selects and returns a list of regions for a particular country identified by its short code. |
61+
| [`GetCountries()`](./docs/README.md) | Gets the list of all country names. |
62+
| [`GetPhoneCodeByCountryShortCode(string shortCode)`](./docs/README.md) | Returns a single country's phone code by its short code. |
63+
| [`GetCountryByPhoneCode(string phoneCode)`](./docs/README.md) | Returns country data for the country associated with the specified phone code. |
64+
| [`GetCurrencyCodesByCountryCode(string shortCode)`](./docs/README.md) | Returns a list of currency codes for a specific country identified by its short code. |
65+
| [`GetCountryByCurrencyCode(string currencyCode)`](./docs/README.md) | Returns a list of countries that use the specified currency code. |
66+
| [`GetCountryCode(string countryName)`](./docs/README.md) | Returns the country code for a specific country name. |
67+
68+
69+
4570
### Initialize the Country data object
4671

4772
```cSharp
@@ -81,7 +106,7 @@ For more detailed instructions and comprehensive information about the library,
81106
.ToList();
82107
```
83108

84-
109+
### Get Country Data by Country Code
85110
This example demonstrates how to retrieve a country with a specific phone code using the `GetCountryByPhoneCode` method. In this case, we're fetching the country with the phone code "+233".
86111

87112
```csharp
@@ -111,7 +136,6 @@ We are committed to fostering a welcoming and respectful community for everyone.
111136
* Country ShortCode Enums
112137

113138

114-
115139
### License
116140

117141
This project is licensed under the terms of the [LICENSE](LICENSE).

docs/README.md

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,14 @@ This method is particularly useful for applications that need to display or anal
116116

117117

118118

119-
### GetCountryEmojiFlag(string shortCode)
119+
### GetCountryEmojiFlag (string shortCode)
120120

121-
The `GetCountryEmojiFlag()` method is designed to fetch the flag of a specific country using its ISO 3166-1 alpha-2 code. This method provides a simple and effective way to visually represent countries in your application.
121+
The `GetCountryEmojiFlag ()` method is designed to fetch the flag of a specific country using its ISO 3166-1 alpha-2 code. This method provides a simple and effective way to visually represent countries in your application.
122122

123123
Here's the method signature in C#:
124124

125125
```csharp
126-
string GetCountryEmojiFlag(string shortCode);
126+
string GetCountryFlag (string shortCode);
127127
```
128128

129129
This method returns the em flag of the country corresponding to the provided ISO code. It's particularly useful when you need to display a country's flag in a user interface or in text-based communication.
@@ -159,4 +159,43 @@ Country GetCountryByPhoneCode(string phoneCode);
159159
This method is particularly useful when you have a phone code and need to retrieve the corresponding country's information. Simply pass the phone code as a string argument, and the method will return a `Country` object filled with relevant data.
160160

161161

162+
### GetCurrencyCodesByCountryCode(string shortCode)
163+
164+
The `GetCurrencyCodesByCountryCode()` method is designed to fetch the currency codes used in a specific country using its ISO 3166-1 alpha-2 code. This method returns a `List<string>`, with each string representing a distinct currency code used in the specified country.
165+
166+
Here's the method signature in C#:
167+
168+
```csharp
169+
170+
List<string> GetCurrencyCodesByCountryCode(string shortCode);
171+
```
172+
173+
This method is particularly useful for applications that need to display or analyze currency data within a specific country. Simply pass the country
174+
175+
### GetCountryByCurrencyCode(string currencyCode)
176+
177+
The `GetCountryByCurrencyCode()` method is designed to fetch detailed data for a specific country using its currency code. This method returns a `Country` object, providing a wealth of information about the country, including its name, region, flag, and ISO code.
178+
179+
Here's the method signature in C#:
180+
181+
```csharp
182+
183+
Country GetCountryByCurrencyCode(string currencyCode);
184+
```
185+
186+
This method is particularly useful when you have a currency code and need to retrieve the corresponding country's information. Simply pass the currency code as a string argument, and the method will return a `Country` object filled with relevant data.
187+
188+
189+
### GetCountryCode(string countryName)
190+
191+
The `GetCountryCode()` method is designed to fetch the ISO 3166-1 alpha-2 code for a specific country using its name. This method returns a string containing the country's ISO code, making it easy to identify countries based on their names.
192+
193+
Here's the method signature in C#:
194+
195+
```csharp
196+
197+
string GetCountryCode(string countryName);
198+
```
199+
200+
162201

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<base href="/" />
8+
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
9+
<link rel="stylesheet" href="app.css" />
10+
<link rel="stylesheet" href="CountryData.Sample.Blazor.styles.css" />
11+
<link rel="icon" type="image/png" href="favicon.png" />
12+
<HeadOutlet />
13+
</head>
14+
15+
<body>
16+
<Routes />
17+
<script src="_framework/blazor.web.js"></script>
18+
</body>
19+
20+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@inherits LayoutComponentBase
2+
3+
<div class="page">
4+
<div class="sidebar">
5+
<NavMenu />
6+
</div>
7+
8+
<main>
9+
<div class="top-row px-4">
10+
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a>
11+
</div>
12+
13+
<article class="content px-4">
14+
@Body
15+
</article>
16+
</main>
17+
</div>
18+
19+
<div id="blazor-error-ui">
20+
An unhandled error has occurred.
21+
<a href="" class="reload">Reload</a>
22+
<a class="dismiss">🗙</a>
23+
</div>
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
.page {
2+
position: relative;
3+
display: flex;
4+
flex-direction: column;
5+
}
6+
7+
main {
8+
flex: 1;
9+
}
10+
11+
.sidebar {
12+
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
13+
}
14+
15+
.top-row {
16+
background-color: #f7f7f7;
17+
border-bottom: 1px solid #d6d5d5;
18+
justify-content: flex-end;
19+
height: 3.5rem;
20+
display: flex;
21+
align-items: center;
22+
}
23+
24+
.top-row ::deep a, .top-row ::deep .btn-link {
25+
white-space: nowrap;
26+
margin-left: 1.5rem;
27+
text-decoration: none;
28+
}
29+
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
33+
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
38+
39+
@media (max-width: 640.98px) {
40+
.top-row {
41+
justify-content: space-between;
42+
}
43+
44+
.top-row ::deep a, .top-row ::deep .btn-link {
45+
margin-left: 0;
46+
}
47+
}
48+
49+
@media (min-width: 641px) {
50+
.page {
51+
flex-direction: row;
52+
}
53+
54+
.sidebar {
55+
width: 250px;
56+
height: 100vh;
57+
position: sticky;
58+
top: 0;
59+
}
60+
61+
.top-row {
62+
position: sticky;
63+
top: 0;
64+
z-index: 1;
65+
}
66+
67+
.top-row.auth ::deep a:first-child {
68+
flex: 1;
69+
text-align: right;
70+
width: 0;
71+
}
72+
73+
.top-row, article {
74+
padding-left: 2rem !important;
75+
padding-right: 1.5rem !important;
76+
}
77+
}
78+
79+
#blazor-error-ui {
80+
background: lightyellow;
81+
bottom: 0;
82+
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
83+
display: none;
84+
left: 0;
85+
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
86+
position: fixed;
87+
width: 100%;
88+
z-index: 1000;
89+
}
90+
91+
#blazor-error-ui .dismiss {
92+
cursor: pointer;
93+
position: absolute;
94+
right: 0.75rem;
95+
top: 0.5rem;
96+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<div class="top-row ps-3 navbar navbar-dark">
2+
<div class="container-fluid">
3+
<a class="navbar-brand" href="">CountryData.Sample.Blazor</a>
4+
</div>
5+
</div>
6+
7+
<input type="checkbox" title="Navigation menu" class="navbar-toggler" />
8+
9+
<div class="nav-scrollable" onclick="document.querySelector('.navbar-toggler').click()">
10+
<nav class="flex-column">
11+
<div class="nav-item px-3">
12+
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
13+
<span class="bi bi-house-door-fill-nav-menu" aria-hidden="true"></span> Home
14+
</NavLink>
15+
</div>
16+
17+
18+
19+
20+
21+
</nav>
22+
</div>
23+

0 commit comments

Comments
 (0)