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
keystring- Key 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
detailIdstring- ID of Detail object to delete
Delete(string, string, string, string)
Delete Detail object by row ID, language ID, product ID and optional product variant ID
[Obsolete("Use Delete(detailId As String) instead")]
public void Delete(string detailId, string detailLanguageId, string detailProductId, string detailVariantId)
Parameters
detailIdstring- ID of Detail object to delete
detailLanguageIdstring- Product language ID
detailProductIdstring- Product ID
detailVariantIdstring- Product variant ID (optional)
GetAllValues()
public IEnumerable<Detail> GetAllValues()
Returns
GetDefaultDetail(Product)
Gets default detail for product consider inheritance
public Detail GetDefaultDetail(Product product)
Parameters
productProduct- The 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
detailIdstring- ID of Detail row
Returns
GetDetail(string, string, string)
Gets the detail by ID, related product ID and variant ID
[Obsolete("Use GetDetail(detailId) instead.")]
public Detail GetDetail(string detailId, string detailProductId, string detailVariantId)
Parameters
detailIdstring- ID of Detail row
detailProductIdstring- Related product ID
detailVariantIdstring- Product variant ID
Returns
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
productProduct- Product 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
productProduct- Product to select details for
detailTypestring- Details 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
productProduct- Product to select details for
detailTypestring- Details type, use an empty string to select all details
excludeDefaultImagebool- Indicates 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
detailLanguageIdstring- Product language ID
detailProductIdstring- Product ID
detailVariantIdstring- Product variant ID (optional)
detailTypestring- Details 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
detailTypestring- The type of detail, which should be found
excludeDefaultImagebool- Indicates if the Detail marked as 'Default' should be excluded from the result
Returns
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
detailDetail- Detail to save
detailProductIdstring- Product ID
detailVariantIdstring- Product 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