Class DynamicProductRelationService
- Namespace
- Dynamicweb.Ecommerce.Products.DynamicRelations
- Assembly
- Dynamicweb.Ecommerce.dll
public abstract class DynamicProductRelationService : ICacheStorage<string, DynamicProductRelation>, ICacheStorage<string>, ICacheStorage
- Inheritance
-
DynamicProductRelationService
- 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(IEnumerable<string>)
Resets the specified keys to the default value for objects stored in the object cache
public abstract 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 abstract void ClearCache(string key)
Parameters
keystringKey to reset
Delete(IEnumerable<string>)
Deletes the specified entities identified by their unique identifiers.
public abstract Result<int> Delete(IEnumerable<string> ids)
Parameters
idsIEnumerable<string>A collection of unique identifiers representing the entities to be deleted. Cannot be null or empty.
Returns
GetAll()
Retrieves all dynamic product relations.
public abstract IEnumerable<DynamicProductRelation> GetAll()
Returns
- IEnumerable<DynamicProductRelation>
An IEnumerable<T> of DynamicProductRelation objects representing all available dynamic product relations.
GetByDynamicRelationGroupId(string)
Retrieves a collection of DynamicProductRelation objects associated with the specified dynamic relation group ID.
public abstract IEnumerable<DynamicProductRelation> GetByDynamicRelationGroupId(string dynamicRelationGroupId)
Parameters
dynamicRelationGroupIdstringThe unique identifier of the dynamic relation group whose related products are to be retrieved. Cannot be null or empty.
Returns
- IEnumerable<DynamicProductRelation>
An IEnumerable<T> of DynamicProductRelation objects. The collection will be empty if no relations are found for the specified group ID.
GetById(string)
Retrieves a DynamicProductRelation object by its unique identifier.
public abstract DynamicProductRelation? GetById(string id)
Parameters
idstringThe unique identifier of the DynamicProductRelation to retrieve. Cannot be null or empty.
Returns
- DynamicProductRelation
A DynamicProductRelation object if found; otherwise, null.
GetByIds(IEnumerable<string>)
Retrieves a collection of DynamicProductRelation objects based on the specified identifiers.
public abstract IEnumerable<DynamicProductRelation> GetByIds(IEnumerable<string> ids)
Parameters
idsIEnumerable<string>A collection of unique identifiers for the desired DynamicProductRelation objects. Cannot be null or empty.
Returns
- IEnumerable<DynamicProductRelation>
An IEnumerable<T> containing the DynamicProductRelation objects that match the specified identifiers. The collection will be empty if no matches are found.
GetByProductId(string)
Retrieves a collection of dynamic product relations associated with the specified product identifier.
public abstract IEnumerable<DynamicProductRelation> GetByProductId(string productId)
Parameters
productIdstringThe unique identifier of the product for which to retrieve related dynamic product relations. Cannot be null or empty.
Returns
- IEnumerable<DynamicProductRelation>
An IEnumerable<T> of DynamicProductRelation objects associated with the specified product identifier. Returns an empty collection if no relations are found.
GetByProductIdInDynamicRelationGroup(string, string)
Retrieves a collection of dynamic product relations associated with a specified product ID within a given dynamic relation group.
public abstract IEnumerable<DynamicProductRelation> GetByProductIdInDynamicRelationGroup(string productId, string dynamicRelationGroupId)
Parameters
productIdstringThe unique identifier of the product for which to retrieve dynamic relations. Cannot be null or empty.
dynamicRelationGroupIdstringThe unique identifier of the dynamic relation group to search within. Cannot be null or empty.
Returns
- IEnumerable<DynamicProductRelation>
An enumerable collection of DynamicProductRelation objects that represent the dynamic relations for the specified product within the group. The collection will be empty if no relations are found.
Save(DynamicProductRelation)
Saves the specified dynamic product relation to the underlying data store.
public abstract void Save(DynamicProductRelation relation)
Parameters
relationDynamicProductRelationThe dynamic product relation to be saved. Cannot be null.
Remarks
This method persists the provided DynamicProductRelation instance, ensuring that any changes made to the relation are stored.
SetCacheType<TObjectCache>()
Changes the storage container
public abstract void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<string, DynamicProductRelation>
Type Parameters
TObjectCache