Previous Docs Version

The documentation you are viewing is for a previous version of the Vendr product. Click here to jump to the current stable version.

ICountryService

API reference for ICountryService in Vendr, the eCommerce solution for Umbraco v8+

ICountryService

Defines the Vendr Country service

public interface ICountryService : ICachedEntityService<CountryReadOnly>, 
    ICachedEntityService<RegionReadOnly>, IService

Inheritance

Namespace

Methods

CountryExists

Check to see if a CountryReadOnly exists in the given Store with the given ISO Code

public bool CountryExists(Guid storeId, string code)

Parameters

Parameter Description
storeId
The ID of the Store the CountryReadOnly entity belongs to
code
The ISO Code of the CountryReadOnly entity to check

Returns

Returns true if the CountryReadOnly exists, otherwise returns false.


CreateAllCountryRegions

Creates all CountryReadOnly and RegionReadOnly entities for a store based on IS03166 country list

public void CreateAllCountryRegions(Guid storeId, Guid defaultCurrencyId)

Parameters

Parameter Description
storeId
The ID of the Store the RegionReadOnly entity belongs to
defaultCurrencyId
The ID of the CurrencyReadOnly to use as the default currency

DeleteCountry (1 of 2)

Deletes a Country

public void DeleteCountry(Guid id)

Parameters

Parameter Description
id
The ID of the Country to delete

DeleteCountry (2 of 2)

Deletes a Country

public void DeleteCountry(Country entity)

Parameters

Parameter Description
entity
The Country to delete

DeleteRegion (1 of 2)

Deletes a Region

public void DeleteRegion(Guid id)

Parameters

Parameter Description
id
The ID of the Region to delete

DeleteRegion (2 of 2)

Deletes a Region

public void DeleteRegion(Region entity)

Parameters

Parameter Description
entity
The Region to delete

GetCountries

Get a list of all CountryReadOnly entities from the given Store

public IEnumerable<CountryReadOnly> GetCountries(Guid storeId)

Parameters

Parameter Description
storeId
The ID of the Store the CountryReadOnly entities belong to

Returns

A list of CountryReadOnly entities


GetCountry (1 of 2)

Get a CountryReadOnly entity by ID

public CountryReadOnly GetCountry(Guid id)

Parameters

Parameter Description
id
The ID of the CountryReadOnly entity to fetch

Returns

A CountryReadOnly entity


GetCountry (2 of 2)

Get a CountryReadOnly entity by Store and ISO Code

public CountryReadOnly GetCountry(Guid storeId, string code)

Parameters

Parameter Description
storeId
The ID of the Store the CountryReadOnly entity belongs to
code
The ISO Code of the CountryReadOnly entity to fetch

Returns

A CountryReadOnly entity


GetIso3166CountryRegions

Get a list of Iso3166Country entities

public IEnumerable<Iso3166Country> GetIso3166CountryRegions()

Returns

A list of Iso3166Country entities


GetRegion (1 of 2)

Get a RegionReadOnly entity by ID

public RegionReadOnly GetRegion(Guid id)

Parameters

Parameter Description
id
The ID of the RegionReadOnly entity to fetch

Returns

A RegionReadOnly entity


GetRegion (2 of 2)

Get a RegionReadOnly entity by Store and Code

public RegionReadOnly GetRegion(Guid storeId, Guid countryId, string code)

Parameters

Parameter Description
storeId
The ID of the Store the RegionReadOnly entity belongs to
countryId
The ID of the Country the RegionReadOnly entity belongs to
code
The Code of the RegionReadOnly entity to fetch

Returns

A RegionReadOnly entity


GetRegions (1 of 2)

Get a list of all RegionReadOnly entities from the given Store

public IEnumerable<RegionReadOnly> GetRegions(Guid storeId)

Parameters

Parameter Description
storeId
The ID of the Store the RegionReadOnly entities belong to

Returns

A list of RegionReadOnly entities


GetRegions (2 of 2)

Get a list of all RegionReadOnly entities from the given Store and Country

public IEnumerable<RegionReadOnly> GetRegions(Guid storeId, Guid countryId)

Parameters

Parameter Description
storeId
The ID of the Store the RegionReadOnly entities belong to
countryId
The ID of the Country the RegionReadOnly entities belong to

Returns

A list of RegionReadOnly entities


RegionExists

Check to see if a RegionReadOnly exists in the given Store / CountryReadOnly with the given Code

public bool RegionExists(Guid storeId, Guid countryId, string code)

Parameters

Parameter Description
storeId
The ID of the Store the RegionReadOnly entity belongs to
countryId
The ID of the CountryReadOnly the RegionReadOnly entity belongs to
code
The Code of the RegionReadOnly entity to check

Returns

Returns true if the RegionReadOnly exists, otherwise returns false.


SaveCountry

Saves a Country

public void SaveCountry(Country entity)

Parameters

Parameter Description
entity
The Country to save

SaveRegion

Saves a Region

public void SaveRegion(Region entity)

Parameters

Parameter Description
entity
The Region to save

SortCountries

Sorts a list of Country entities by ID according to the order of those IDs

public void SortCountries(Guid[] sortedIds)

Parameters

Parameter Description
sortedIds
The IDs of the Country entities to sort, in the order by which to sort them

SortRegions

Sorts a list of Region entities by ID according to the order of those IDs

public void SortRegions(Guid[] sortedIds)

Parameters

Parameter Description
sortedIds
The IDs of the Region entities to sort, in the order by which to sort them

Edit this page on GitHub

Site + logo design © 2024 Outfield Digital Ltd. Content contributions licensed under MIT.
Vendr® is a Registered Trademark of Outfield Digital Ltd.