Class VariantCombinationService
- Namespace
- Dynamicweb.Ecommerce.Variants
- Assembly
- Dynamicweb.Ecommerce.dll
public class VariantCombinationService : ICacheStorage<string, IDictionary<string, VariantCombination>>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
VariantCombinationService
- Implements
- Inherited Members
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<string> keys)
Parameters
keys
IEnumerable<string>Keys to reset
ClearCache(string)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(string key)
Parameters
key
stringKey to reset
CrossProduct<T>(IEnumerable<IEnumerable<T>>)
Gets the cross product for two or more sequences (A x B).
public static IEnumerable<IEnumerable<T>> CrossProduct<T>(IEnumerable<IEnumerable<T>> sequences)
Parameters
sequences
IEnumerable<IEnumerable<T>>Sequence of datasets to cross
Returns
Type Parameters
T
Type of objects in the datasets
Examples
Twodimensional example for DataSet A and DataSet B all combinations of any value from A (a) combined with any combination of a value from B (b) Formally written as (a,b) where a in A, b in B or A x B
Delete(string)
Deletes the combinations for the specified product ID.
public void Delete(string productId)
Parameters
productId
stringThe product ID.
Delete(string, string)
Deletes the combinations for the specified product and variant ID.
public void Delete(string productId, string variantId)
Parameters
GetAllPossibleVariantIds(IEnumerable<VariantGroup>, string)
public IList<string> GetAllPossibleVariantIds(IEnumerable<VariantGroup> variantGroups, string languageId)
Parameters
variantGroups
IEnumerable<VariantGroup>languageId
string
Returns
GetVariantCombination(string, string)
Gives a variant combination for a product id.
public VariantCombination GetVariantCombination(string productId, string variantId)
Parameters
Returns
- VariantCombination
variantCombinations
GetVariantCombinations(string)
Gives all variant combinations for a product.
public IList<VariantCombination> GetVariantCombinations(string productId)
Parameters
productId
stringId of product
Returns
- IList<VariantCombination>
variantCombinations
Save(VariantCombination)
Saves the current instance with the specified parameters.
public void Save(VariantCombination variantCombination)
Parameters
variantCombination
VariantCombinationThe variant.