Table of Contents

Class FieldValueConversionService

Namespace
Dynamicweb.Ecommerce.Products.FieldValueConversions
Assembly
Dynamicweb.Ecommerce.dll

The service provides methods for fetching, adding, updating and removing field value conversion data.

public class FieldValueConversionService : ICacheStorage<int, FieldValueConversion>, ICacheStorage<int>, ICacheStorage
Inheritance
FieldValueConversionService
Implements
Inherited Members

Properties

Info

Information about the object cache

public CacheInformation Info { get; }

Property Value

CacheInformation

Methods

ClearCache()

Resets all keys to the default value for objects stored in the object cache

public void ClearCache()

ClearCache(IEnumerable<int>)

Resets the specified keys to the default value for objects stored in the object cache

public 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 void ClearCache(int key)

Parameters

key int

Key to reset

CreatePredefinedConversions(string, IList<string>, string)

Creates collection of predefined conversions based on systemnames of conversions subset from GetPredefinedConversions(string)

public virtual IList<FieldValueConversion> CreatePredefinedConversions(string groupSystemName, IList<string> selectedConversionSystemNames, string baseConversionSystemName)

Parameters

groupSystemName string

Predefined conversion group system name

selectedConversionSystemNames IList<string>

Conversion system names

baseConversionSystemName string

Base conversion system name

Returns

IList<FieldValueConversion>

Collection of conversions recalculated based on predefined considering specified base conversion

Exceptions

InvalidOperationException

Thrown when predefined conversions does not have base conversion.

InvalidOperationException

Thrown when base conversion cannot be found by baseConversionSystemName on selected conversions.

Delete(int)

Delete the field value conversion.

public virtual void Delete(int fieldValueConversionId)

Parameters

fieldValueConversionId int

The field value conversion

DeleteByParent(int)

Delete field value conversions by parent group.

public virtual void DeleteByParent(int parentGroupId)

Parameters

parentGroupId int

The id of field value conversion parent group

DeleteGroup(int)

Deletes the specified field value conversion group and removes its associations from all fields that reference it.

public virtual void DeleteGroup(int fieldValueConversionGroupId)

Parameters

fieldValueConversionGroupId int

The ID of the field value conversion group to delete.

GetBaseUnit(int)

Gets the base field value conversion unit for a group.

public virtual FieldValueConversion? GetBaseUnit(int parentGroupId)

Parameters

parentGroupId int

The id of field value conversion parent group

Returns

FieldValueConversion

GetById(int)

Gets the field value conversion by id.

public virtual FieldValueConversion? GetById(int fieldValueConversionId)

Parameters

fieldValueConversionId int

The field value conversion id

Returns

FieldValueConversion

GetByParent(int)

Gets field value conversion units by parent group.

public virtual IEnumerable<FieldValueConversion> GetByParent(int parentGroupId)

Parameters

parentGroupId int

The id of field value conversion parent group

Returns

IEnumerable<FieldValueConversion>

GetBySystemName(int, string)

Gets the field value conversion by system name.

public virtual FieldValueConversion? GetBySystemName(int parentGroupId, string systemName)

Parameters

parentGroupId int

The id of field value conversion parent group

systemName string

The field value conversion system name

Returns

FieldValueConversion

GetGroupUsages(IEnumerable<int>)

Returns all field value conversion usages that are associated with the specified group identifiers.

public virtual IEnumerable<FieldValueConversionUsage> GetGroupUsages(IEnumerable<int> fieldValueConversionGroupIds)

Parameters

fieldValueConversionGroupIds IEnumerable<int>

A collection of field value conversion group identifiers to search for usages. If null or empty, no usages will be returned.

Returns

IEnumerable<FieldValueConversionUsage>

An enumerable collection of FieldValueConversionUsage objects representing usages found for the specified group identifiers. The collection is empty if no usages are found.

GetPredefinedConversions(string)

Gets predefined conversions for group system name from GetPredefinedGroups()

public virtual IEnumerable<FieldValueConversion> GetPredefinedConversions(string groupSystemName)

Parameters

groupSystemName string

The group system name

Returns

IEnumerable<FieldValueConversion>

Collection of predefined conversions

GetUsages(IEnumerable<int>)

Gets FieldValueConversion using references collection.

public virtual IEnumerable<FieldValueConversionUsage> GetUsages(IEnumerable<int> fieldValueConversionIds)

Parameters

fieldValueConversionIds IEnumerable<int>

The list of the FieldValueConversion IDs.

Returns

IEnumerable<FieldValueConversionUsage>

Save(FieldValueConversion)

Saves the field value conversion.

public virtual void Save(FieldValueConversion fieldValueConversion)

Parameters

fieldValueConversion FieldValueConversion

The field value conversion

SetCacheType<TObjectCache>()

Changes the storage container

public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<int, FieldValueConversion>

Type Parameters

TObjectCache

UpdateSortOrder(IEnumerable<int>)

Update field value conversion units sort order.

public virtual void UpdateSortOrder(IEnumerable<int> ids)

Parameters

ids IEnumerable<int>

The ordered collection of field value conversion id

To top