Class CountryCache
Inherited Members
Namespace: SuperOffice.CRM.Globalization
Assembly: SoDataBase.dll
Syntax
[CacheV2(0)]
public class CountryCache : CacheBaseV2
Constructors
CountryCache()
Declaration
public CountryCache()
Properties
TableNames
Gets the names of the table data that are cached in this cache. When these tables are updated the cache will be disposed so a new cache instance can take its place.
Declaration
protected override IEnumerable<string> TableNames { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<string> |
Overrides
Methods
GetCountryIds()
Get all country ids
Declaration
public int[] GetCountryIds()
Returns
| Type | Description |
|---|---|
| int[] | List of all country ids |
GetFromCountryName(string)
Get a the Country information object from its name. The name can be exact or partial match.
Declaration
public Country GetFromCountryName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | Name of the country: "norge", "Norge" or "NORGE" |
Returns
| Type | Description |
|---|---|
| Country | The Country information object, or null if not found |
GetFromId(int)
Get the Country information object from the countries primary key (this is no longer the phone prefix).
Declaration
public Country GetFromId(int countryId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | countryId | Countries primary key (this is no longer the phone prefix) |
Returns
| Type | Description |
|---|---|
| Country | The Country information object |
GetFromIso(string)
Get a the Country information object from its name. The name can be either 2 or 3 letter ISO abbreviations for the country or the official name of the country in english.
Declaration
public Country GetFromIso(string isoCode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | isoCode | Name of the country: 2 and 3 letter ISO abbriviation for the name and name of the country according to ISO. e.g: "no" or "nor", "gb" or "gbr" |
Returns
| Type | Description |
|---|---|
| Country | The Country information object, or null if not found |
GetFromPhoneNumber(string)
Get the Country information object from the country's phone prefix (e.g. "47" returns the CountryRow for Norway).
Declaration
public Country GetFromPhoneNumber(string strippedPhoneNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| string | strippedPhoneNumber |
Returns
| Type | Description |
|---|---|
| Country | The Country information object |
GetFromPhonePrefix(string)
Get the Country information object from the country's phone prefix (e.g. "47" returns the CountryRow for Norway).
Declaration
public Country GetFromPhonePrefix(string phonePrefix)
Parameters
| Type | Name | Description |
|---|---|---|
| string | phonePrefix | International dialing prefix: "+47" or "47" |
Returns
| Type | Description |
|---|---|
| Country | The Country information object, or null if not found |
OnLoad()
Declaration
protected override void OnLoad()
Overrides
OnLoadAsync(CancellationToken)
Declaration
[CreateSyncVersion(OmitNullableDirective = true)]
protected override Task OnLoadAsync(CancellationToken cancellationToken)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task |
Overrides
ParseMultiLanguageString(string)
Parse a multi-language string according to the default language of the current user's home country
Declaration
public string ParseMultiLanguageString(string multiLangString)
Parameters
| Type | Name | Description |
|---|---|---|
| string | multiLangString | The multilanguage string to parse |
Returns
| Type | Description |
|---|---|
| string | Parsed string; or original string if there is a problem |
Examples
String example from PrefDesc table: US:"Location and size";GE:"Position und Größe";NO:"Posisjon og størrelse"