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
keysIEnumerable<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
keystring- Key to reset
Delete(IEnumerable<Product>)
Deletes all relations.
public void Delete(IEnumerable<Product> products)
Parameters
productsIEnumerable<Product>- The products.
Delete(string, string, string, string)
Deletes the instance
public void Delete(string productId, string relatedGroupId, string relatedProductId, string relatedVariantId)
Parameters
productIdstring- The product id.
relatedGroupIdstring- The related group id.
relatedProductIdstring- The related product id.
relatedVariantIdstring- The related product variant id.
FindRelationsToProduct(string)
public IEnumerable<ProductRelated> FindRelationsToProduct(string relatedProductId)
Parameters
relatedProductIdstring
Returns
FindRelationsToProduct(string, string)
public IEnumerable<ProductRelated> FindRelationsToProduct(string relatedProductId, string relatedProductVariantId)
Parameters
Returns
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
productIdstring- The product id.
relatedGroupIdstring- The related group id.
relatedProductIdstring- The related product id.
relatedVariantIdstring- The related product variant id.
Returns
GetRelations()
Gets all relations
public IEnumerable<ProductRelated> GetRelations()
Returns
GetRelations(string)
Gets the related products.
public IEnumerable<ProductRelated> GetRelations(string productId)
Parameters
productIdstring- The product id.
Returns
GetRelations(string, string)
Gets the related products.
public IEnumerable<ProductRelated> GetRelations(string productId, string relatedGroupId)
Parameters
Returns
GetRelations(string, string, bool)
Gets the related products.
public IEnumerable<ProductRelated> GetRelations(string productId, string languageId, bool activeOnly)
Parameters
productIdstring- The product id.
languageIdstring- The product language id.
activeOnlybool- Set to
trueto get only active products.
Returns
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
productIdstring- The product id.
variantIdstringlanguageIdstring- The product language id.
activeOnlybool- Set to
trueto get only active products. shopIdstringcountryCodestring
Returns
Save(ProductRelated)
Saves the properties into DB.
public void Save(ProductRelated productRelated)
Parameters
productRelatedProductRelated- The product related.
SetCache(ProductRelated)
public void SetCache(ProductRelated relatedProduct)
Parameters
relatedProductProductRelated
SetCache(string, IEnumerable<ProductRelated>)
public void SetCache(string key, IEnumerable<ProductRelated> relatedProducts)
Parameters
keystringrelatedProductsIEnumerable<ProductRelated>