Class ShopService
- Namespace
- Dynamicweb.Ecommerce.Shops
- Assembly
- Dynamicweb.Ecommerce.dll
The ShopService class providing methods for querying and saving The Shop Aggregate to and from persistence.
public class ShopService : ICacheStorage<string, Shop>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
ShopService
- Implements
- Inherited Members
Methods
CanDeleteShop(Shop)
Determines whether the shop can be deleted.
public bool CanDeleteShop(Shop shop)
Parameters
shop
Shop- The shop.
Returns
- bool
True
, if the shop and its groups could be deleted, otherwiseFalse
.
CleanDefault()
Sets IsDefault to
False
for all shops in solution.public void CleanDefault()
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(string)
Deletes the shop.
public void Delete(string shopId)
Parameters
shopId
string- The shop ID.
GetDefaultLanguageId(string)
Gets the default shop.
public string GetDefaultLanguageId(string shopId)
Parameters
shopId
string- The shop ID.
Returns
GetDefaultShop()
public Shop GetDefaultShop()
Returns
GetProductCountByShopsForBackendTree()
Gets product count in all shops for current language, without variants.
[Obsolete("Use GetProductCountByShopsForBackendTree(languageId) instead.")]
public Dictionary<string, int> GetProductCountByShopsForBackendTree()
Returns
- Dictionary<string, int>
- The count of products in all shops for current language, without variants.
GetProductCountByShopsForBackendTree(string)
Gets product count in all shops for current language, without variants.
public Dictionary<string, int> GetProductCountByShopsForBackendTree(string languageId)
Parameters
languageId
string
Returns
- Dictionary<string, int>
- The count of products in all shops for current language, without variants.
GetProductCountForBackendTree(string)
Gets product count in shop for current language, without variants.
[Obsolete("Use GetProductCountForBackendTree(shopId, languageId) instead.")]
public int GetProductCountForBackendTree(string shopId)
Parameters
shopId
string- The shop ID.
Returns
- int
- The count of products in shop for current language, without variants.
GetProductCountForBackendTree(string, string)
Gets product count in shop for current language, without variants.
public int GetProductCountForBackendTree(string shopId, string languageId)
Parameters
Returns
- int
- The count of products in shop for current language, without variants.
GetShop(string)
Gets the shop.
public Shop GetShop(string shopId)
Parameters
shopId
string- The shop ID.
Returns
GetShopLanguages(string)
Gets the shop languages.
[Obsolete("Use GetShopRelatedLanguages")]
public LanguageCollection GetShopLanguages(string shopId)
Parameters
shopId
string- The shop ID.
Returns
- LanguageCollection
- The instance of the LanguageCollection, that contains all languages for the shop.
GetShopRelatedLanguages(string)
Gets the shop languages.
public IEnumerable<Language> GetShopRelatedLanguages(string shopId)
Parameters
shopId
string- The shop ID.
Returns
- IEnumerable<Language>
- The instance of the LanguageCollection, that contains all languages for the shop.
GetShops()
Gets all shops in solution.
public IEnumerable<Shop> GetShops()
Returns
- IEnumerable<Shop>
- The collection of the Shop.
HasGroups(Shop)
Gets the value indicating whether shop has groups.
public bool HasGroups(Shop shop)
Parameters
shop
Shop- The shop.
Returns
Save(Shop)
Saves the shop.
public Shop Save(Shop shop)
Parameters
shop
Shop- The shop.
Returns
- Shop
- The shop after saving.