Class CountryRelationService
- Namespace
- Dynamicweb.Ecommerce.International
- Assembly
- Dynamicweb.Ecommerce.dll
public class CountryRelationService : ICacheStorage<CountryRelationKey, IList<CountryRelation>>, ICacheStorage<CountryRelationKey>, ICacheStorage
- Inheritance
-
CountryRelationService
- Implements
- Inherited Members
Properties
Info
Information about the object cache
public virtual CacheInformation Info { get; }
Property Value
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public virtual void ClearCache()
ClearCache(CountryRelationKey)
Resets the specified key to the default value for objects stored in the object cache
public virtual void ClearCache(CountryRelationKey key)
Parameters
keyCountryRelationKeyKey to reset
ClearCache(IEnumerable<CountryRelationKey>)
Resets the specified keys to the default value for objects stored in the object cache
public virtual void ClearCache(IEnumerable<CountryRelationKey> keys)
Parameters
keysIEnumerable<CountryRelationKey>Keys to reset
Delete(string)
Deletes an instance with the specified code.
public virtual void Delete(string code2)
Parameters
code2stringThe country relation code.
Delete(string, string)
Deletes an instance with the specified parameters.
public virtual void Delete(string methodType, string methodId)
Parameters
GetCountryRelation(string, string, string, string)
Gets the country relations.
public virtual CountryRelation? GetCountryRelation(string methodType, string methodId, string countryId, string regionCode)
Parameters
methodTypestringThe method type.
methodIdstringThe method id.
countryIdstringThe country id.
regionCodestringThe region code.
Returns
- CountryRelation
A collection of the CountryRelation.
Remarks
- Return any match on both country AND region.
- Return any match on country where countryRelation.RegionCode Is null Or empty.
- No match was found. Return Nothing.
GetCountryRelations(string, string)
Gets the country relations.
public virtual IEnumerable<CountryRelation> GetCountryRelations(string methodType, string methodId)
Parameters
Returns
- IEnumerable<CountryRelation>
A collection of the CountryRelation.
Save(CountryRelation)
Saves an instance with the specified parameters.
public virtual void Save(CountryRelation relation)
Parameters
relationCountryRelationThe country relation.
Save(IEnumerable<string>, string, string)
Saves the country relations.
public virtual void Save(IEnumerable<string> countryRelationKeys, string methodType, string methodId)
Parameters
countryRelationKeysIEnumerable<string>The collection of country relation keys represented as strings.
methodTypestringThe method type.
methodIdstringThe method id.
SetCacheType<TObjectCache>()
Changes the storage container
public virtual void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<CountryRelationKey, IList<CountryRelation>>
Type Parameters
TObjectCache
UpdateDefaultCountryRelation(string, string, string)
Update default country relation
public virtual void UpdateDefaultCountryRelation(string methodType, string countryId, string defaultId)