Table of Contents

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

CacheInformation

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

keys IEnumerable<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

key string

Key to reset

Delete(string)

Deletes the product item with the given ID.

public abstract void Delete(string itemId)

Parameters

itemId string

DB 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

itemId string

DB field name is ProductItemID.

productId string

DB 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

bomProductId string

DB field name is ProductItemBomProductID.

bomVariantId string

DB 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

groupIds IEnumerable<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

productIds IEnumerable<string>

The product IDs whose items should be deleted.

GetAll()

Gets all cached product items.

public abstract IEnumerable<ProductItem> GetAll()

Returns

IEnumerable<ProductItem>

GetById(string)

Gets the product item with the given ID, or null when no match exists.

public abstract ProductItem? GetById(string id)

Parameters

id string

DB field name is ProductItemID.

Returns

ProductItem

GetByProduct(Product)

Gets the product items belonging to the given product.

public abstract ProductItemCollection GetByProduct(Product product)

Parameters

product Product

The product.

Returns

ProductItemCollection

GetByProductId(string)

Gets the product items registered for the given product ID.

public abstract ProductItemCollection GetByProductId(string productId)

Parameters

productId string

DB field name is ProductItemProductID.

Returns

ProductItemCollection

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

item ProductItem

The product item to save.

SetCacheType<TObjectCache>()

Changes the storage container

public abstract void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, ProductItem>

Type Parameters

TObjectCache
To top