Class AddressValidatorService
- Namespace
- Dynamicweb.Ecommerce.Orders.AddressValidation
- Assembly
- Dynamicweb.Ecommerce.dll
Provides access to the configured address validators, and validates addresses and orders through them.
public class AddressValidatorService : ICacheStorage<int, AddressValidator>, ICacheStorage<int>, ICacheStorage
- Inheritance
-
AddressValidatorService
- Implements
- Inherited Members
Fields
MethodType
public static readonly string MethodType
Field Value
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(IEnumerable<int>)
Resets the specified keys to the default value for objects stored in the object cache
public virtual void ClearCache(IEnumerable<int> keys)
Parameters
keysIEnumerable<int>Keys to reset
ClearCache(int)
Resets the specified key to the default value for objects stored in the object cache
public virtual void ClearCache(int key)
Parameters
keyintKey to reset
Delete(int)
Deletes this instance.
public virtual void Delete(int addressValidatorId)
Parameters
addressValidatorIdintThe address validator id.
GetActiveAddressValidators(Order, string)
Gets active AddressValidators for an order.
public virtual IEnumerable<AddressValidator> GetActiveAddressValidators(Order order, string defaultCountryCode)
Parameters
Returns
GetAddressValidatorById(int)
Gets the Address validator by id.
public virtual AddressValidator? GetAddressValidatorById(int addressValidatorId)
Parameters
addressValidatorIdintThe address validator id.
Returns
GetAddressValidators()
Gets address validators.
public virtual IEnumerable<AddressValidator> GetAddressValidators()
Returns
- IEnumerable<AddressValidator>
The validators that have at least one country relation.
GetAddressValidatorsByCountryCode(string)
Gets address validators with the suitable country code.
public virtual IEnumerable<AddressValidator> GetAddressValidatorsByCountryCode(string countryCode)
Parameters
countryCodestringThe country code.
Returns
Save(AddressValidator)
Saves this settings instance.
public virtual void Save(AddressValidator addressValidator)
Parameters
addressValidatorAddressValidatorThe address validator.
SetCacheType<TObjectCache>()
Changes the storage container
public virtual void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<int, AddressValidator>
Type Parameters
TObjectCache
Validate(Order, string)
Validate the addresses.
public virtual bool Validate(Order order, string defaultCountryCode)
Parameters
Returns
Validate(UserAddress, string)
Validate the addresses.
public virtual bool Validate(UserAddress address, string languageId)
Parameters
addressUserAddressThe order.
languageIdstringThe language ID.