Class ShopGroupRelationService
- Namespace
- Dynamicweb.Ecommerce.Shops
- Assembly
- Dynamicweb.Ecommerce.dll
The ShopGroupRelationService class providing methods for querying and saving The ShopGroupRelation Aggregate to and from persistence.
public abstract class ShopGroupRelationService : ICacheStorage<ShopGroupRelationKey, ShopGroupRelation>, ICacheStorage<ShopGroupRelationKey>, ICacheStorage
- Inheritance
-
ShopGroupRelationService
- Implements
- Inherited Members
Properties
Info
Information about the object cache
public abstract CacheInformation Info { get; }
Property Value
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public abstract void ClearCache()
ClearCache(ShopGroupRelationKey)
Resets the specified key to the default value for objects stored in the object cache
public abstract void ClearCache(ShopGroupRelationKey key)
Parameters
keyShopGroupRelationKeyKey to reset
ClearCache(IEnumerable<ShopGroupRelationKey>)
Resets the specified keys to the default value for objects stored in the object cache
public abstract void ClearCache(IEnumerable<ShopGroupRelationKey> keys)
Parameters
keysIEnumerable<ShopGroupRelationKey>Keys to reset
Delete(ShopGroupRelationKey)
Deletes the specified shop group relation.
public abstract void Delete(ShopGroupRelationKey key)
Parameters
keyShopGroupRelationKeyThe key identifying the shop group relation to delete. Cannot be null.
Remarks
This method removes the relation associated with the provided key from the underlying data store. Ensure that the key corresponds to an existing relation to avoid unexpected behavior.
DeleteByGroup(string)
Deletes all items associated with the specified group identifier.
public abstract void DeleteByGroup(string groupId)
Parameters
groupIdstringThe unique identifier of the group whose items are to be deleted. Cannot be null or empty.
Remarks
This method removes all items linked to the given group ID. Ensure that the group ID is valid and corresponds to an existing group.
GetByGroup(string)
Retrieves all ShopGroupRelations for the supplied groupId.
public abstract IEnumerable<ShopGroupRelation> GetByGroup(string groupId)
Parameters
groupIdstringThe group identifier to filter ShopGroupRelations by.
Returns
GetByKey(ShopGroupRelationKey)
Returns the ShopGroupRelation for the supplied key, or null if none found.
public abstract ShopGroupRelation? GetByKey(ShopGroupRelationKey key)
Parameters
keyShopGroupRelationKeyThe key of the ShopGroupRelation to retrieve.
Returns
GetDefaultByGroup(string)
Returns the single most relevant ShopGroupRelation for the supplied groupId, or null if none found.
Selection strategy:
1. If only one relation exists for the group, return that.
2. If multiple relations exist, return the one created first (lowest AutoId).
public abstract ShopGroupRelation? GetDefaultByGroup(string groupId)
Parameters
groupIdstring
Returns
Save(ShopGroupRelation)
Saves the specified shop group relation to the underlying data store.
public abstract void Save(ShopGroupRelation shopGroupRelation)
Parameters
shopGroupRelationShopGroupRelationThe shop group relation to be saved. Cannot be null.
SetCacheType<TObjectCache>()
Changes the storage container
public abstract void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<ShopGroupRelationKey, ShopGroupRelation>
Type Parameters
TObjectCache