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
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<Product>)
Delete details for collection of products
public void Delete(IEnumerable<Product> products)
Parameters
productsIEnumerable<Product>Related products collection.
Delete(string)
Delete Detail object by row ID
public void Delete(string detailId)
Parameters
detailIdstringID 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
productProductThe 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
detailIdstringID 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
languageVariantProductThe Product of the family, containing information about where the product was previously located
newProductIdstringThe 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
productProductProduct 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
productProductProduct to select details for
detailTypestringDetails 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
productProductProduct to select details for
detailTypestringDetails type, use an empty string to select all details
excludeDefaultImageboolIndicates 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
detailLanguageIdstringProduct language ID
detailProductIdstringProduct ID
detailVariantIdstringProduct variant ID (optional)
detailTypestringDetails 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
productKeysIEnumerable<ProductKey>The products which details will be found for
detailTypestringThe type of detail, which should be found
excludeDefaultImageboolIndicates 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
productKeysIEnumerable<ProductKey>The products which details will be found for
detailTypestringThe 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
moveSettingsIEnumerable<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
detailDetailDetail to save
detailProductIdstringProduct ID
detailVariantIdstringProduct 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