Class DetailService
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
public class DetailService : ICacheStorage<string, Detail>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
DetailService
- Implements
- Inherited Members
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<Product>)
Delete details for collection of products
public void Delete(IEnumerable<Product> products)
Parameters
products
IEnumerable<Product>Related products collection.
Delete(string)
Delete Detail object by row ID
public void Delete(string detailId)
Parameters
detailId
stringID of Detail object to delete
GetAllDetailsByProductId(string, string)
public IEnumerable<Detail> GetAllDetailsByProductId(string productId, string detailType)
Parameters
Returns
GetAllValues()
public IEnumerable<Detail> GetAllValues()
Returns
GetDefaultDetail(Product)
Gets default detail for product consider inheritance
public Detail GetDefaultDetail(Product product)
Parameters
product
ProductThe product for realted detail.
Returns
- Detail
The defautlt detail.
GetDefaultDetail(string, string, string)
Gets default detail for product consider inheritance
public Detail GetDefaultDetail(string productId, string productVariantId, string languageId)
Parameters
Returns
- Detail
The defautlt detail.
GetDetail(string)
Gets the detail by ID
public Detail GetDetail(string detailId)
Parameters
detailId
stringID of Detail row
Returns
GetDetailMoveSettings(Product, string)
Identifies which Details should be extracted from one product and moved to the other Product
public virtual IEnumerable<DetailMoveSetting> GetDetailMoveSettings(Product languageVariant, string newProductId)
Parameters
languageVariant
ProductThe Product of the family, containing information about where the product was previously located
newProductId
stringThe new ProductId the product will be given after it has been extracted
Returns
Exceptions
- ArgumentNullException
If languageVariant is null
GetDetails()
Select all product details
public IEnumerable<Detail> GetDetails()
Returns
- IEnumerable<Detail>
Collection of Detail objects for all products in database
GetDetails(Product)
Select details for a product
public IEnumerable<Detail> GetDetails(Product product)
Parameters
product
ProductProduct to select details for
Returns
- IEnumerable<Detail>
Collection of Detail objects for income product
GetDetails(Product, string)
Selected details of some type for income product
public IEnumerable<Detail> GetDetails(Product product, string detailType)
Parameters
product
ProductProduct to select details for
detailType
stringDetails type, use an empty string to select all details
Returns
- IEnumerable<Detail>
Collection of Detail objects
GetDetails(Product, string, bool)
Selected details of some type for income product
public IEnumerable<Detail> GetDetails(Product product, string detailType, bool excludeDefaultImage)
Parameters
product
ProductProduct to select details for
detailType
stringDetails type, use an empty string to select all details
excludeDefaultImage
boolIndicates if detail images marked as 'Default' should be excluded
Returns
- IEnumerable<Detail>
Collection of Detail objects
GetDetails(string, string, string, string)
Selected details of some type for income product
public IEnumerable<Detail> GetDetails(string detailLanguageId, string detailProductId, string detailVariantId, string detailType)
Parameters
detailLanguageId
stringProduct language ID
detailProductId
stringProduct ID
detailVariantId
stringProduct variant ID (optional)
detailType
stringDetails type, use an empty string to select all details
Returns
- IEnumerable<Detail>
Collection of Detail objects
GetDetailsBulk(IEnumerable<ProductKey>, string, bool)
Gets the details for all the given products
public Dictionary<string, List<Detail>> GetDetailsBulk(IEnumerable<ProductKey> productKeys, string detailType, bool excludeDefaultImage)
Parameters
productKeys
IEnumerable<ProductKey>The products which details will be found for
detailType
stringThe type of detail, which should be found
excludeDefaultImage
boolIndicates if the Detail marked as 'Default' should be excluded from the result
Returns
GetPrimaryDetailsBulk(IEnumerable<ProductKey>, string)
Gets the primary detail for all the given products
public Dictionary<string, List<Detail>> GetPrimaryDetailsBulk(IEnumerable<ProductKey> productKeys, string detailType)
Parameters
productKeys
IEnumerable<ProductKey>The products which details will be found for
detailType
stringThe type of detail, which should be found
Returns
MoveDetails(IEnumerable<DetailMoveSetting>)
Moves ProductCategoryFieldValues from one product to another.
public void MoveDetails(IEnumerable<DetailMoveSetting> moveSettings)
Parameters
moveSettings
IEnumerable<DetailMoveSetting>This determins which values should be moved and where from/to
Save(Detail, Product)
Save details for provided product
public void Save(Detail detail, Product product)
Parameters
Save(Detail, string, string)
Save details for provided product and variant
public void Save(Detail detail, string detailProductId, string detailVariantId)
Parameters
detail
DetailDetail to save
detailProductId
stringProduct ID
detailVariantId
stringProduct variant ID
Remarks
If there is no existing detail row for detailId, procedure creates the new one
SetDetailsGroup(Detail, int?)
Assign details group to detail
public void SetDetailsGroup(Detail detail, int? groupId)
Parameters
SetDetailsGroup(Product, string, int?)
Assign details group to detail
public void SetDetailsGroup(Product product, string detailId, int? groupId)
Parameters
UpdateDefaultDetailForProduct(Product, string)
Updates default detail for specific product
public void UpdateDefaultDetailForProduct(Product product, string detailId)
Parameters
Remarks
If detail Id not set - updates all the details so they are not default