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
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
stringKey to reset
Delete(IEnumerable<Price>)
Deletes the provided prices.
public virtual bool Delete(IEnumerable<Price> prices)
Parameters
prices
IEnumerable<Price>The prices to delete.
Returns
Exceptions
- ArgumentNullException
Throws exception if the
prices
are null.
Delete(IEnumerable<string>)
Deletes the provided price IDs.
public virtual bool Delete(IEnumerable<string> priceIds)
Parameters
priceIds
IEnumerable<string>The price IDs to delete.
Returns
Exceptions
- ArgumentNullException
Throws exception if the
priceIds
are null.
Delete(string)
Deletes the price by ID.
public virtual bool Delete(string priceId)
Parameters
priceId
stringThe 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
context
PriceContextselection
PriceProductSelectionisInformative
bool
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
context
PriceContextproduct
ProductisInformative
bool
Returns
GetById(string)
Get the price by ID.
public virtual Price? GetById(string priceId)
Parameters
priceId
stringThe 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
productId
stringThe 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
productIds
IEnumerable<string>The IDs of the products.
Returns
Exceptions
- ArgumentNullException
Throws exception if the
productIds
are null.
MovePrices(IEnumerable<PriceMoveSetting>)
public virtual int MovePrices(IEnumerable<PriceMoveSetting> moveSettings)
Parameters
moveSettings
IEnumerable<PriceMoveSetting>
Returns
Save(Price)
Saves the provided prices.
public virtual bool Save(Price price)
Parameters
price
PriceThe prices to save.
Returns
Exceptions
- ArgumentNullException
Throws exception if the
price
are null.
SetCacheType<TObjectCache>()
Changes the storage container
public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, Price>
Type Parameters
TObjectCache