Class ProductItemService
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
public abstract class ProductItemService : ICacheStorage<string, ProductItem>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
ProductItemService
- Implements
- Inherited Members
Properties
Info
Information about the object cache
public abstract CacheInformation Info { get; }
Property Value
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public abstract void ClearCache()
ClearCache(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public abstract 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 abstract void ClearCache(string key)
Parameters
keystringKey to reset
Delete(string)
Deletes the product item with the given ID.
public abstract void Delete(string itemId)
Parameters
itemIdstringDB field name is ProductItemID.
Delete(string, string)
Deletes the product item with the given ID belonging to the given product.
public abstract void Delete(string itemId, string productId)
Parameters
itemIdstringDB field name is ProductItemID.
productIdstringDB field name is ProductItemProductID.
DeleteBom(string, string?)
Deletes the product items that reference the given BOM product and variant.
public abstract void DeleteBom(string bomProductId, string? bomVariantId)
Parameters
bomProductIdstringDB field name is ProductItemBomProductID.
bomVariantIdstringDB field name is ProductItemBomVariantID.
DeleteByGroups(IEnumerable<string>)
Deletes the product items that reference the given BOM group IDs.
public abstract void DeleteByGroups(IEnumerable<string> groupIds)
Parameters
groupIdsIEnumerable<string>The group IDs whose items should be deleted.
DeleteByProducts(IEnumerable<string>)
Deletes the product items belonging to, or referencing as a BOM, the given product IDs.
public abstract void DeleteByProducts(IEnumerable<string> productIds)
Parameters
productIdsIEnumerable<string>The product IDs whose items should be deleted.
GetAll()
Gets all cached product items.
public abstract IEnumerable<ProductItem> GetAll()
Returns
GetById(string)
Gets the product item with the given ID, or null when no match exists.
public abstract ProductItem? GetById(string id)
Parameters
idstringDB field name is ProductItemID.
Returns
GetByProduct(Product)
Gets the product items belonging to the given product.
public abstract ProductItemCollection GetByProduct(Product product)
Parameters
productProductThe product.
Returns
GetByProductId(string)
Gets the product items registered for the given product ID.
public abstract ProductItemCollection GetByProductId(string productId)
Parameters
productIdstringDB field name is ProductItemProductID.
Returns
Save(ProductItem)
Saves the given product item, assigning a new ID when it does not already have one.
public abstract void Save(ProductItem item)
Parameters
itemProductItemThe product item to save.
SetCacheType<TObjectCache>()
Changes the storage container
public abstract void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, ProductItem>
Type Parameters
TObjectCache