Interface ICountryService
ICountryService is for getting country information
Namespace: DirectScale.Disco.Extension.Services
Assembly: DirectScale.Disco.Extension.Abstractions.dll
Syntax
public interface ICountryService
Remarks
country code will normally be the ISO ISO 3166-1 alpha two digit country code, but can be configred in corporate admin settings "Countries" page to be any value up to 3 digits long.
Methods
GetAllCountryLanguages()
Gets the languages for every active country.
Declaration
Task<CountryLanguage[]> GetAllCountryLanguages()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<CountryLanguage[]> | Array of objects mapping countries to languages. |
GetCountries()
Gets all country details for countries set in admin page "Countries"
Declaration
Task<Country[]> GetCountries()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Country[]> | Array of Countries. |
GetCountry(String)
Gets the information about countryCode
Declaration
Task<Country> GetCountry(string countryCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | countryCode | Country code to find. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Country> | A Country instance with information about the country. Null if the |
GetCountryLanguages(String)
Gets the configured languages for specified countryCode
.
Declaration
Task<CountryLanguage[]> GetCountryLanguages(string countryCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | countryCode | The specific country to find language information for. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<CountryLanguage[]> | All languages configured for that country. |
GetDefaultLanguageCode(String)
Gets the default language specified for countryCode
.
Declaration
Task<CountryLanguage> GetDefaultLanguageCode(string countryCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | countryCode | The specific country to find language information for. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<CountryLanguage> | The default language configured for that country. |
GetState(String, String)
Gets state details for specified countryCode
and stateCode
.
Declaration
Task<State> GetState(string countryCode, string stateCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | countryCode | ISO 3166-1 alpha-2 country code. |
System.String | stateCode | ISO 3166-2 state code |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<State> | Full name for state. |
GetStates(String)
Gets all state details for specified countryCode
.
Declaration
Task<State[]> GetStates(string countryCode)
Parameters
Type | Name | Description |
---|---|---|
System.String | countryCode | ISO 3166-1 alpha-2 country code. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<State[]> | All state names and code in |