Class GroupService
- Namespace
- Dynamicweb.Ecommerce.Products
- Assembly
- Dynamicweb.Ecommerce.dll
The GroupService class providing methods for querying and saving the Group aggregate to and from persistence.
- Inheritance
-
Group
Service
- Implements
- Inherited Members
Properties
DataModelPrefix
Property Value
Methods
AddGroupRelationForProductIds(IEnumerable<string>, IEnumerable<string>)
Adds group relation to specified product ids
public void AddGroupRelationForProductIds(IEnumerable<string> groupIds, IEnumerable<string> productIds)
Parameters
groupIds
IEnumerable<string>The group ids
productIds
IEnumerable<string>The product ids
AddRelatedGroups(Group, IEnumerable<string>)
Adds related group ids to speficified group
Parameters
group
GroupThe group
relatedGroupIds
IEnumerable<string>The related group ids
AddRelatedProductId(Group, string, string, string)
Adds the related product to group.
public void AddRelatedProductId(Group group, string relatedGroupId, string productId, string variantId)
Parameters
group
GroupThe group.
relatedGroupId
stringThe relation group ID.
productId
stringThe product ID.
variantId
stringThe variant ID.
AddSubgroup(Group, Group)
Adds a subgroup to group.
Parameters
ClearCache()
Clears all the product group cache.
ClearCache(GroupKey)
Resets the specified key to the default value for objects stored in the object cache
Parameters
key
GroupKey Key to reset
ClearCache(IEnumerable<GroupKey>)
Resets the specified keys to the default value for objects stored in the object cache
Parameters
keys
IEnumerable<GroupKey >Keys to reset
CreateProductGroupRelation(string, string, bool?)
Creates the new product group relation.
public ProductGroupRelation CreateProductGroupRelation(string productId, string groupId, bool? isPrimary = null)
Parameters
productId
stringThe product Id.
groupId
stringThe group Id.
isPrimary
bool?Is this group primary.
Returns
Delete(Group)
Deletes the group.
Parameters
group
GroupThe group.
Delete(GroupCollection)
Deletes appropriate relations between shops, other groups and products as well.
Parameters
groups
GroupCollection The groups collection.
DeleteGroupsAndProductsByGroupKeys(IEnumerable<GroupKey>)
Deletes groups by given group keys and also deletes the products from removed groups if the products only belong to those groups
Parameters
groupKeysToDelete
IEnumerable<GroupKey >The group keys to be deleted
DeleteRelatedProductId(Group, string, string, string)
Deletes the related product from relation.
public void DeleteRelatedProductId(Group group, string relatedGroupId, string productId, string variantId)
Parameters
group
GroupThe group.
relatedGroupId
stringThe relation group ID.
productId
stringThe product ID to delete.
variantId
stringThe product variant ID to delete.
DeleteRelation(string, string)
Deletes the specified product relation.
Parameters
DeleteRelations(IEnumerable<Product>, string)
Deletes the specified product relations.
Parameters
products
IEnumerable<Product>The products
groupId
stringThe group Id.
Returns
- int
The number of rows affected by the command.
FindPath(Shop, Group)
Find path from shop to group.
Parameters
Returns
- IEnumerable<Group>
returns path to group include target group or empty if path not found
GetDataModelSystemName(string)
Parameters
groupName
string
Returns
GetGroup(string, string)
Gets the group.
Parameters
Returns
- Group
The group.
GetGroup(string, string, bool)
Gets the group.
Parameters
groupId
stringThe group ID.
languageId
stringThe language ID.
showUnTranslated
boolDetermines whether untranslated group could be returned.
Returns
- Group
The group.
GetGroups(IEnumerable<string>)
Gets groups by provided group IDs in default language.
Parameters
groupIds
IEnumerable<string>The list of group IDs.
Returns
- IEnumerable<Group>
Groups ordered by name
GetGroups(string)
Gets groups by language ID.
Parameters
languageId
stringThe language ID.
Returns
- IEnumerable<Group>
The Group
Collection .
GetGroupsByKeys(IEnumerable<GroupKey>)
Parameters
groupKeys
IEnumerable<GroupKey >
Returns
GetProductCountForBackendTree(string, string?)
Gets the number of the products in the group.
Parameters
Returns
- int
The number of products with the specified language ID in the group.
GetProductGroupRelation(string, string)
Gets the product group relation.
Parameters
Returns
GetProductGroupRelations(string)
Gets the product group relations.
Parameters
productId
stringThe product Id.
Returns
GetRelatedGroups(IEnumerable<ProductGroupRelation>, string)
public IEnumerable<Group> GetRelatedGroups(IEnumerable<ProductGroupRelation> relations, string languageId)
Parameters
relations
IEnumerable<ProductGroup >Relation languageId
string
Returns
GetRelatedProducts(Group, string)
Gets the list of related products for relation group. Related products are used as default list of related products for child products.
Parameters
Returns
- IEnumerable<Product>
Related products collection
GetSubgroups(Group)
Gets the subgroups for this Group in the same language as the group.
Parameters
group
Group
Returns
GetSubgroups(Group, bool)
Gets the list of child groups in current or default language.
Parameters
Returns
HasSubgroups(Group)
Defines if a group includes child elements.
Parameters
group
Group
Returns
IsParentGroup(Group, string)
Determines whether source group is a parent of target group (might be not direct parent).
Parameters
Returns
MoveToGroup(IEnumerable<Product>, string, string)
Moves to group.
Parameters
products
IEnumerable<Product>The products.
toGroupId
stringThe destination group id.
fromGroupId
stringThe source group id.
Returns
- int
The number of rows affected by the command.
RemoveRelatedGroups(Group, IEnumerable<string>)
Removes related group ids from speficified group
Parameters
group
GroupThe group
relatedGroupIds
IEnumerable<string>The related group ids
Save(Group)
Saves the group.
Parameters
group
GroupThe group.
Save(ProductGroupRelation)
Saves the product group relation
Parameters
relation
ProductGroup Relation The product group relation.