Table of Contents

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

CacheInformation

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 string

Key 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

bool

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

bool

Exceptions

ArgumentNullException

Throws exception if the priceIds are null.

Delete(string)

Deletes the price by ID.

public virtual bool Delete(string priceId)

Parameters

priceId string

The ID of the price to delete.

Returns

bool

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 PriceContext
selection PriceProductSelection
isInformative bool

Returns

IEnumerable<Price>

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 PriceContext
product Product
isInformative bool

Returns

IEnumerable<Price>

GetById(string)

Get the price by ID.

public virtual Price? GetById(string priceId)

Parameters

priceId string

The 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 string

The 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

IEnumerable<Price>

Exceptions

ArgumentNullException

Throws exception if the productIds are null.

MovePrices(IEnumerable<PriceMoveSetting>)

public virtual int MovePrices(IEnumerable<PriceMoveSetting> moveSettings)

Parameters

moveSettings IEnumerable<PriceMoveSetting>

Returns

int

Save(Price)

Saves the provided prices.

public virtual bool Save(Price price)

Parameters

price Price

The prices to save.

Returns

bool

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
To top