Table of Contents

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

string

Properties

Info

Information about the object cache

public virtual CacheInformation Info { get; }

Property Value

CacheInformation

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

keys IEnumerable<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

key int

Key to reset

Delete(int)

Deletes this instance.

public virtual void Delete(int addressValidatorId)

Parameters

addressValidatorId int

The address validator id.

GetActiveAddressValidators(Order, string)

Gets active AddressValidators for an order.

public virtual IEnumerable<AddressValidator> GetActiveAddressValidators(Order order, string defaultCountryCode)

Parameters

order Order

The order.

defaultCountryCode string

The default country code.

Returns

IEnumerable<AddressValidator>

GetAddressValidatorById(int)

Gets the Address validator by id.

public virtual AddressValidator? GetAddressValidatorById(int addressValidatorId)

Parameters

addressValidatorId int

The address validator id.

Returns

AddressValidator

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

countryCode string

The country code.

Returns

IEnumerable<AddressValidator>

Save(AddressValidator)

Saves this settings instance.

public virtual void Save(AddressValidator addressValidator)

Parameters

addressValidator AddressValidator

The 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

order Order

The order.

defaultCountryCode string

The default country code.

Returns

bool

Validate(UserAddress, string)

Validate the addresses.

public virtual bool Validate(UserAddress address, string languageId)

Parameters

address UserAddress

The order.

languageId string

The language ID.

Returns

bool
To top