Class PriceService
- Namespace
- Dynamicweb.Ecommerce.Prices
- Assembly
- Dynamicweb.Ecommerce.dll
Service for managing prices.
public class PriceService : ICacheStorage<string, Price>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
PriceService
- Implements
- Inherited Members
Properties
Info
Information about the object cache
public CacheInformation Info { get; }
Property Value
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
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
keystringKey to reset
Delete(IEnumerable<Price>)
Deletes the provided prices.
public virtual bool Delete(IEnumerable<Price> prices)
Parameters
pricesIEnumerable<Price>The prices to delete.
Returns
Exceptions
- ArgumentNullException
Throws exception if the
pricesare null.
Delete(IEnumerable<string>)
Deletes the provided price IDs.
public virtual bool Delete(IEnumerable<string> priceIds)
Parameters
priceIdsIEnumerable<string>The price IDs to delete.
Returns
Exceptions
- ArgumentNullException
Throws exception if the
priceIdsare null.
Delete(string)
Deletes the price by ID.
public virtual bool Delete(string priceId)
Parameters
priceIdstringThe ID of the price to delete.
Returns
FindPrices(PriceContext, PriceProductSelection, bool)
Gets the prices valid for the provided context and product selection.
public virtual IEnumerable<Price> FindPrices(PriceContext context, PriceProductSelection selection, bool isInformative)
Parameters
contextPriceContextselectionPriceProductSelectionisInformativebool
Returns
FindQuantityPrices(PriceContext, Product, bool)
Gets the quantity prices for a product in a given context.
public virtual IEnumerable<Price> FindQuantityPrices(PriceContext context, Product product, bool isInformative)
Parameters
contextPriceContextproductProductisInformativebool
Returns
GetById(string)
Get the price by ID.
public virtual Price? GetById(string priceId)
Parameters
priceIdstringThe price ID.
Returns
- Price
The matching price.
GetByProductId(string)
Gets the prices for a given product ID.
public virtual IEnumerable<Price> GetByProductId(string productId)
Parameters
productIdstringThe product ID to filter by.
Returns
- IEnumerable<Price>
The prices matching the given product ID.
GetByProductIds(IEnumerable<string>)
Gets the prices for the provided product IDs.
public virtual IEnumerable<Price> GetByProductIds(IEnumerable<string> productIds)
Parameters
productIdsIEnumerable<string>The IDs of the products.
Returns
Exceptions
- ArgumentNullException
Throws exception if the
productIdsare null.
MovePrices(IEnumerable<PriceMoveSetting>)
public virtual int MovePrices(IEnumerable<PriceMoveSetting> moveSettings)
Parameters
moveSettingsIEnumerable<PriceMoveSetting>
Returns
Save(Price)
Saves the provided prices.
public virtual bool Save(Price price)
Parameters
pricePriceThe prices to save.
Returns
Exceptions
- ArgumentNullException
Throws exception if the
priceare null.
SetCacheType<TObjectCache>()
Changes the storage container
public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, Price>
Type Parameters
TObjectCache