Table of Contents

Class ProductRelatedService

Namespace
Dynamicweb.Ecommerce.Products
Assembly
Dynamicweb.Ecommerce.dll
public class ProductRelatedService : ICacheStorage<string, IEnumerable<ProductRelated>>, ICacheStorage<string>, ICacheStorage
Inheritance
ProductRelatedService
Implements
Inherited Members

Methods

ClearCache()

Clears the 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 string

Key to reset

Delete(IEnumerable<Product>)

Deletes all relations.

public void Delete(IEnumerable<Product> products)

Parameters

products IEnumerable<Product>

The products.

Delete(string, string, string, string)

Deletes the instance

public void Delete(string productId, string relatedGroupId, string relatedProductId, string relatedVariantId)

Parameters

productId string

The product id.

relatedGroupId string

The related group id.

relatedProductId string

The related product id.

relatedVariantId string

The related product variant id.

FindRelationsToProduct(string)

public IEnumerable<ProductRelated> FindRelationsToProduct(string relatedProductId)

Parameters

relatedProductId string

Returns

IEnumerable<ProductRelated>

FindRelationsToProduct(string, string)

public IEnumerable<ProductRelated> FindRelationsToProduct(string relatedProductId, string relatedProductVariantId)

Parameters

relatedProductId string
relatedProductVariantId string

Returns

IEnumerable<ProductRelated>

GetProductRelated(string, string, string, string)

Initializes a new instance of the ProductRelated class.

public ProductRelated GetProductRelated(string productId, string relatedGroupId, string relatedProductId, string relatedVariantId)

Parameters

productId string

The product id.

relatedGroupId string

The related group id.

relatedProductId string

The related product id.

relatedVariantId string

The related product variant id.

Returns

ProductRelated

GetRelatedProductKeys(IEnumerable<string>)

Gets the related product keys by string representations of RelatedProductKey.

public IEnumerable<RelatedProductKey> GetRelatedProductKeys(IEnumerable<string> keys)

Parameters

keys IEnumerable<string>

Collection of keys, which represented by strings. See ToString().

Returns

IEnumerable<RelatedProductKey>

GetRelations()

Gets all relations

public IEnumerable<ProductRelated> GetRelations()

Returns

IEnumerable<ProductRelated>

GetRelations(string)

Gets the related products.

public IEnumerable<ProductRelated> GetRelations(string productId)

Parameters

productId string

The product id.

Returns

IEnumerable<ProductRelated>

GetRelations(string, string)

Gets the related products.

public IEnumerable<ProductRelated> GetRelations(string productId, string relatedGroupId)

Parameters

productId string

The product id.

relatedGroupId string

The related group id.

Returns

IEnumerable<ProductRelated>

GetRelations(string, string, bool)

Gets the related products.

public IEnumerable<ProductRelated> GetRelations(string productId, string languageId, bool activeOnly)

Parameters

productId string

The product id.

languageId string

The product language id.

activeOnly bool

Set to true to get only active products.

Returns

IEnumerable<ProductRelated>

GetRelations(string, string, string, bool, string, string)

Gets the related products.

public IEnumerable<ProductRelated> GetRelations(string productId, string variantId, string languageId, bool activeOnly, string shopId = null, string countryCode = null)

Parameters

productId string

The product id.

variantId string
languageId string

The product language id.

activeOnly bool

Set to true to get only active products.

shopId string
countryCode string

Returns

IEnumerable<ProductRelated>

GetStructuredRelations(string, bool)

Gets a collection of product-group relations represented by a dictionary of key-relation pair.

public Dictionary<RelatedProductKey, ProductRelated> GetStructuredRelations(string productId, bool excludeVariants)

Parameters

productId string

The product id.

excludeVariants bool

Indicates whether product variant relations should be excluded.

Returns

Dictionary<RelatedProductKey, ProductRelated>

GetStructuredRelations(string, bool, string)

Gets a collection of product-group relations represented by a dictionary of key-relation pair.

public Dictionary<RelatedProductKey, ProductRelated> GetStructuredRelations(string productId, bool excludeVariants, string relatedGroupId)

Parameters

productId string

The product id.

excludeVariants bool

Indicates whether product variant relations should be excluded.

relatedGroupId string

The related group id. This is used to filter the relations and return only relations that belong to this group.

Returns

Dictionary<RelatedProductKey, ProductRelated>

Save(ProductRelated)

Saves the properties into DB.

public void Save(ProductRelated productRelated)

Parameters

productRelated ProductRelated

The product related.

SetCache(ProductRelated)

public void SetCache(ProductRelated relatedProduct)

Parameters

relatedProduct ProductRelated

SetCache(string, IEnumerable<ProductRelated>)

public void SetCache(string key, IEnumerable<ProductRelated> relatedProducts)

Parameters

key string
relatedProducts IEnumerable<ProductRelated>
To top