Table of Contents

Class AssortmentService

Namespace
Dynamicweb.Ecommerce.Assortments
Assembly
Dynamicweb.Ecommerce.dll
public class AssortmentService : ICacheStorage<string, Assortment>, ICacheStorage<string>, ICacheStorage
Inheritance
AssortmentService
Implements
Inherited Members

Methods

BuildAssortment(Assortment)

Starts the assortment building.
public void BuildAssortment(Assortment assortment)

Parameters

assortment Assortment
The assortment object.

ClearAssortmentCache()

Clears the assortments cache.
[Obsolete("Use ClearCache() instead")]
public void ClearAssortmentCache()

ClearAssortmentItemCache()

Clears the assortment items cache.
[Obsolete("Use ClearCache() instead")]
public void ClearAssortmentItemCache()

ClearAssortmentPermissionCache()

Clears the assortment relations cache.
[Obsolete("Use ClearCache() instead")]
public void ClearAssortmentPermissionCache()

ClearAssortmentRelationCache()

Clears the assortment relations cache.
[Obsolete("Use ClearCache() instead")]
public void ClearAssortmentRelationCache()

ClearCache()

Resets all keys to the default value for objects stored in the object cache
public void ClearCache()

ClearCache(AssortmentKey)

[Obsolete("Use ClearCache(string) instead")]
public void ClearCache(AssortmentKey key)

Parameters

key AssortmentKey

ClearCache(IEnumerable<AssortmentKey>)

[Obsolete("Use ClearCache(IEnumerable<string>) instead")]
public void ClearCache(IEnumerable<AssortmentKey> keys)

Parameters

keys IEnumerable<AssortmentKey>

ClearCache(IEnumerable<string>)

Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<string> assortmentIds)

Parameters

assortmentIds IEnumerable<string>

ClearCache(string)

Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(string assortmentId)

Parameters

assortmentId string

DeleteAssortment(Assortment)

Deletes the Assortment and all its items, relations and permissions.
public void DeleteAssortment(Assortment assortment)

Parameters

assortment Assortment
The assortment object.

DeleteAssortmentItem(AssortmentItem)

Deletes the AssortmentItem
public void DeleteAssortmentItem(AssortmentItem assortmentItem)

Parameters

assortmentItem AssortmentItem
The assortment item object.

DeleteAssortmentItems(Assortment)

Deletes the assortment items.
public void DeleteAssortmentItems(Assortment assortment)

Parameters

assortment Assortment
The assortment object.

DeleteAssortmentItems(AssortmentRelation)

Deletes the assortment items.
[Obsolete("Don't use it. Items can't be deleted by assortment relations. Call BuildAssortment instead")]
public void DeleteAssortmentItems(AssortmentRelation assortmentRelation)

Parameters

assortmentRelation AssortmentRelation
The assortment relation object.

DeleteAssortmentItems(IEnumerable<AssortmentItem>)

Deletes the assortment items.
public void DeleteAssortmentItems(IEnumerable<AssortmentItem> assortmentItems)

Parameters

assortmentItems IEnumerable<AssortmentItem>
The assortment items collection.

DeleteAssortmentItems(IEnumerable<AssortmentRelation>)

Deletes the assortment items.
[Obsolete("Don't use it. Items can't be deleted by assortment relations. Call BuildAssortment instead")]
public void DeleteAssortmentItems(IEnumerable<AssortmentRelation> assortmentRelations)

Parameters

assortmentRelations IEnumerable<AssortmentRelation>
The assortment relations collection.

DeleteAssortmentItems(string)

Deletes the assortment items.
public void DeleteAssortmentItems(string assortmentId)

Parameters

assortmentId string
The assortment ID.

DeleteAssortmentItems(string, string)

Deletes the assortment items.
[Obsolete("Use DeleteAssortmentItems(string) instead")]
public void DeleteAssortmentItems(string assortmentId, string languageId)

Parameters

assortmentId string
The assortment ID.
languageId string
The language ID.

DeleteAssortmentPermission(AssortmentPermission)

public void DeleteAssortmentPermission(AssortmentPermission assortmentPermission)

Parameters

assortmentPermission AssortmentPermission
The assortment permission object.

DeleteAssortmentRelation(AssortmentRelation)

Deletes the AssortmentRelation.
public void DeleteAssortmentRelation(AssortmentRelation assortmentRelation)

Parameters

assortmentRelation AssortmentRelation
The assortment relation object.

DeleteAssortmentRelations(Assortment)

Deletes the assortment relations.
public void DeleteAssortmentRelations(Assortment assortment)

Parameters

assortment Assortment
The assortment object.

DeleteAssortmentRelations(IEnumerable<AssortmentRelation>)

Deletes the assortment relations.
public void DeleteAssortmentRelations(IEnumerable<AssortmentRelation> assortmentRelations)

Parameters

assortmentRelations IEnumerable<AssortmentRelation>
The collection of the assortment relations.

DeleteGroupAssortmentRelations(Assortment, string)

Deletes the group assortment relations.
public void DeleteGroupAssortmentRelations(Assortment assortment, string groupId)

Parameters

assortment Assortment
The assortment object.
groupId string
The group ID.

DeleteGroupAssortmentRelations(IEnumerable<AssortmentGroupRelation>)

Deletes the group assortment relations.
public void DeleteGroupAssortmentRelations(IEnumerable<AssortmentGroupRelation> assortmentRelations)

Parameters

assortmentRelations IEnumerable<AssortmentGroupRelation>
The group assortment relations collection.

DeleteProductAssortmentRelations(Assortment, string, string)

Deletes the product assortment relations.
public void DeleteProductAssortmentRelations(Assortment assortment, string productId, string productVariantId)

Parameters

assortment Assortment
The assortment object.
productId string
The product ID.
productVariantId string
The product variant ID.

DeleteProductAssortmentRelations(IEnumerable<AssortmentProductRelation>)

Deletes the product assortment relations.
public void DeleteProductAssortmentRelations(IEnumerable<AssortmentProductRelation> assortmentRelations)

Parameters

assortmentRelations IEnumerable<AssortmentProductRelation>
The product assortment relations collection.

DeleteShopAssortmentRelations(Assortment, string)

Deletes the assortment relations.
public void DeleteShopAssortmentRelations(Assortment assortment, string shopId)

Parameters

assortment Assortment
The assortment object.
shopId string
The shop ID.

DeleteShopAssortmentRelations(IEnumerable<AssortmentShopRelation>)

Deletes the shop assortment relations.
public void DeleteShopAssortmentRelations(IEnumerable<AssortmentShopRelation> assortmentRelations)

Parameters

assortmentRelations IEnumerable<AssortmentShopRelation>
The shop assortment relations collection.

FlagAssortmentForRebuild(Assortment)

Flags the assortment for rebuild.
public void FlagAssortmentForRebuild(Assortment assortment)

Parameters

assortment Assortment
The assortment object.

GetActiveAssortmentIds()

Gets the IDs of the active assortments.
public IEnumerable<string> GetActiveAssortmentIds()

Returns

IEnumerable<string>
A collection of the assortment IDs.

GetActiveAssortments()

Gets all active assortments.
public IEnumerable<Assortment> GetActiveAssortments()

Returns

IEnumerable<Assortment>
A collection of the Assortment.

GetActiveAssortments(string)

Gets all active assortments.
[Obsolete("Use GetActiveAssortments() instead")]
public IEnumerable<Assortment> GetActiveAssortments(string languageId)

Parameters

languageId string

Returns

IEnumerable<Assortment>
A collection of the Assortment.

GetAllAssortmentItems()

Gets all assortment items.
[Obsolete("Dont use it")]
public IEnumerable<AssortmentItem> GetAllAssortmentItems()

Returns

IEnumerable<AssortmentItem>
A collection of the AssortmentItem.

GetAllAssortmentPermissions()

Gets all assortment permissions.
[Obsolete("Don't use this")]
public IEnumerable<AssortmentPermission> GetAllAssortmentPermissions()

Returns

IEnumerable<AssortmentPermission>
A collection of the AssortmentPermission.

GetAllAssortmentRelations()

Gets all assortment relations.
[Obsolete("Don't use it")]
public IEnumerable<AssortmentRelation> GetAllAssortmentRelations()

Returns

IEnumerable<AssortmentRelation>
A collection of the AssortmentRelation.

GetAllAssortments()

Gets all assortments.
public IEnumerable<Assortment> GetAllAssortments()

Returns

IEnumerable<Assortment>
A collection of the Assortment.

GetAllAssortments(string, bool)

Gets all assortments.
[Obsolete("Use GetAllAssortments() instead")]
public IEnumerable<Assortment> GetAllAssortments(string languageId, bool showUntranslated)

Parameters

languageId string
showUntranslated bool

Returns

IEnumerable<Assortment>
A collection of the Assortment.

GetAllowAnonymousUsersAssortmentIds()

Gets the ids of all active assortments for the current language that are available to anonymous uses.
public IEnumerable<string> GetAllowAnonymousUsersAssortmentIds()

Returns

IEnumerable<string>
A collection of the assortment IDs.

GetAssortmentById(string)

Gets the Assortment by ID.
public Assortment GetAssortmentById(string assortmentId)

Parameters

assortmentId string
The assortment ID.

Returns

Assortment
The Assortment.

GetAssortmentById(string, bool)

Gets the Assortment by ID.
[Obsolete("Use GetAssortmentById(string) instead")]
public Assortment GetAssortmentById(string assortmentId, bool showUntranslated)

Parameters

assortmentId string
The assortment ID.
showUntranslated bool
Determines whether untranslated assortment could be returned.

Returns

Assortment
The Assortment.

GetAssortmentById(string, string)

Gets the Assortment by ID.
[Obsolete("Use GetAssortmentById(string) instead")]
public Assortment GetAssortmentById(string assortmentId, string languageId)

Parameters

assortmentId string
The assortment ID.
languageId string
The language ID.

Returns

Assortment
The Assortment.

GetAssortmentById(string, string, bool)

Gets the Assortment by ID.
[Obsolete("Use GetAssortmentById(string) instead")]
public Assortment GetAssortmentById(string assortmentId, string languageId, bool showUntranslated)

Parameters

assortmentId string
The assortment ID.
languageId string
showUntranslated bool
Determines whether untranslated assortment could be returned.

Returns

Assortment
The Assortment.

GetAssortmentIdsByUser(User)

Gets the assortment IDs by user.
[Obsolete("Use GetAssortmentIdsByUser(User, bool) instead.")]
public IEnumerable<string> GetAssortmentIdsByUser(User user)

Parameters

user User
The user.

Returns

IEnumerable<string>
A collection of the assortment IDs.

GetAssortmentIdsByUser(User, bool)

Gets the assortment IDs by user.
public IEnumerable<string> GetAssortmentIdsByUser(User user, bool onlyActive)

Parameters

user User
The user.
onlyActive bool
If true take only active assortments.

Returns

IEnumerable<string>
A collection of the assortment IDs.

GetAssortmentIdsByUser(User, string, bool)

Gets the assortment IDs by user.
[Obsolete("Use GetAssortmentIdsByUser(User, bool) instead")]
public IEnumerable<string> GetAssortmentIdsByUser(User user, string languageId, bool onlyActive)

Parameters

user User
The user.
languageId string
The language Id.
onlyActive bool
If true take only active assortments.

Returns

IEnumerable<string>
A collection of the assortment IDs.

GetAssortmentItemsByAssortmentId(string, string)

Gets the assortment items by assortment ID.
[Obsolete("Don't use it")]
public IEnumerable<AssortmentItem> GetAssortmentItemsByAssortmentId(string assortmentId, string languageId)

Parameters

assortmentId string
The assortment ID.
languageId string
The language ID.

Returns

IEnumerable<AssortmentItem>
A collection of the AssortmentItem.

GetAssortmentItemsByAssortmentRelation(string, int)

Gets the assortment items by relation type.
[Obsolete("Don't use it. Neither relationType neither relationAutoId is filled in items")]
public IEnumerable<AssortmentItem> GetAssortmentItemsByAssortmentRelation(string relationType, int relationAutoId)

Parameters

relationType string
The relation type.
relationAutoId int
The relation auto-ID.

Returns

IEnumerable<AssortmentItem>
A collection of the AssortmentItem.

GetAssortmentItemsByLanguageId(string)

Gets the assortment items by language ID.
[Obsolete("Don't use it.")]
public IEnumerable<AssortmentItem> GetAssortmentItemsByLanguageId(string languageId)

Parameters

languageId string
The language ID.

Returns

IEnumerable<AssortmentItem>
A collection of the AssortmentItem.

GetAssortmentPermissionsByAssortmentId(string)

Gets the assortment permission IDs by user.
[Obsolete("Use Permission property of an assortment instead")]
public IEnumerable<AssortmentPermission> GetAssortmentPermissionsByAssortmentId(string assortmentId)

Parameters

assortmentId string
The assortment ID.

Returns

IEnumerable<AssortmentPermission>
A collection of the AssortmentPermission.

GetAssortmentPermissionsByUser(User)

Gets the assortment permission for user.
[Obsolete("Use GetAssortmentPermissionsByUser(User, bool) instead")]
public IEnumerable<AssortmentPermission> GetAssortmentPermissionsByUser(User user)

Parameters

user User
The user.

Returns

IEnumerable<AssortmentPermission>
A collection of the AssortmentPermission.

GetAssortmentPermissionsByUser(User, bool)

Gets the assortment permission for user.
public IEnumerable<AssortmentPermission> GetAssortmentPermissionsByUser(User user, bool includeGroups)

Parameters

user User
The user.
includeGroups bool
Determines whether assortment permissions for user groups should be included in result collection.

Returns

IEnumerable<AssortmentPermission>
A collection of the AssortmentPermission.

GetAssortmentRelationsByAssortmentId(string)

Gets the assortment relations by assortment ID.
[Obsolete("Use ProductRelations, GroupRelations and ShopRelations properties of an assortment instead")]
public IEnumerable<AssortmentRelation> GetAssortmentRelationsByAssortmentId(string assortmentId)

Parameters

assortmentId string
The assortment ID.

Returns

IEnumerable<AssortmentRelation>
A collection of the AssortmentRelation.

GetAssortmentRelationsByAssortmentId(string, AssortmentRelationType)

Gets the assortment relations by assortment ID.
[Obsolete("Use ProductRelations, GroupRelations and ShopRelations properties of an assortment instead")]
public IEnumerable<AssortmentRelation> GetAssortmentRelationsByAssortmentId(string assortmentId, AssortmentRelationType relationType)

Parameters

assortmentId string
The assortment ID.
relationType AssortmentRelationType
The relation type.

Returns

IEnumerable<AssortmentRelation>
A collection of the AssortmentRelation.

GetAssortmentRelationsByGroupId(string)

Gets the assortment relations by group ID.
public IEnumerable<AssortmentGroupRelation> GetAssortmentRelationsByGroupId(string groupId)

Parameters

groupId string
The group ID.

Returns

IEnumerable<AssortmentGroupRelation>
A collection of the AssortmentGroupRelation.

GetAssortmentRelationsByProductId(string, string)

Gets the assortment relations by product ID.
public IEnumerable<AssortmentProductRelation> GetAssortmentRelationsByProductId(string productId, string productVariantId)

Parameters

productId string
The product ID.
productVariantId string
The product variant ID.

Returns

IEnumerable<AssortmentProductRelation>
A collection of the AssortmentProductRelation.

GetAssortmentRelationsByRelationType(AssortmentRelationType)

Gets the assortment relations by relation type.
[Obsolete("Don't use it")]
public IEnumerable<AssortmentRelation> GetAssortmentRelationsByRelationType(AssortmentRelationType relationType)

Parameters

relationType AssortmentRelationType
The relation type.

Returns

IEnumerable<AssortmentRelation>
A collection of the AssortmentRelation.

GetAssortmentRelationsByShopId(string)

Gets the assortment relations by shop ID.
public IEnumerable<AssortmentShopRelation> GetAssortmentRelationsByShopId(string shopId)

Parameters

shopId string
The shop ID.

Returns

IEnumerable<AssortmentShopRelation>
A collection of the AssortmentShopRelation.

GetAssortmentsByProduct(Product)

Gets the assortments by product.
public IEnumerable<Assortment> GetAssortmentsByProduct(Product product)

Parameters

product Product
The product object.

Returns

IEnumerable<Assortment>
A collection of the Assortment.

GetAssortmentsByProductId(string, string)

Gets the assortments by product ID.
[Obsolete("Use overload with languageId instead.")]
public IEnumerable<Assortment> GetAssortmentsByProductId(string productId, string variantId)

Parameters

productId string
The product ID.
variantId string
The variant ID.

Returns

IEnumerable<Assortment>
A collection of the Assortment.

GetAssortmentsByProductId(string, string, string)

Gets the assortments by product ID.
public IEnumerable<Assortment> GetAssortmentsByProductId(string productId, string variantId, string languageId)

Parameters

productId string
The product ID.
variantId string
The variant ID.
languageId string

Returns

IEnumerable<Assortment>
A collection of the Assortment.

GetAssortmentsForBuild()

Gets assortments which require build.
public IEnumerable<Assortment> GetAssortmentsForBuild()

Returns

IEnumerable<Assortment>
A collection of the Assortment.

GetNotActiveAssortmentIds()

Gets the IDs of the not active assortments.
public IEnumerable<string> GetNotActiveAssortmentIds()

Returns

IEnumerable<string>
A collection of the assortment IDs.

HasAccessToProduct(Product, User)

public bool HasAccessToProduct(Product product, User user)

Parameters

product Product
user User

Returns

bool

HasActiveAssortments()

Determines whether there are active assortments.
public bool HasActiveAssortments()

Returns

bool
True, if solution have one or more active assortments, otherwise False.

LoadAssortmentGroupRelations(string)

public Dictionary<string, AssortmentGroupRelation> LoadAssortmentGroupRelations(string assortmentId)

Parameters

assortmentId string

Returns

Dictionary<string, AssortmentGroupRelation>

LoadAssortmentPermissions(string)

public Dictionary<int, AssortmentPermission> LoadAssortmentPermissions(string assortmentId)

Parameters

assortmentId string

Returns

Dictionary<int, AssortmentPermission>

LoadAssortmentProductRelations(string)

public Dictionary<string, AssortmentProductRelation> LoadAssortmentProductRelations(string assortmentId)

Parameters

assortmentId string

Returns

Dictionary<string, AssortmentProductRelation>

LoadAssortmentShopRelations(string)

public Dictionary<string, AssortmentShopRelation> LoadAssortmentShopRelations(string assortmentId)

Parameters

assortmentId string

Returns

Dictionary<string, AssortmentShopRelation>

SaveAssortment(Assortment, bool)

Saves the Assortment.
public void SaveAssortment(Assortment assortment, bool doInstallStep = true)

Parameters

assortment Assortment
The assortment object.
doInstallStep bool

SaveAssortmentItem(AssortmentItem)

Saves the AssortmentItem.
public void SaveAssortmentItem(AssortmentItem assortmentItem)

Parameters

assortmentItem AssortmentItem
The assortment item object.

SaveAssortmentPermission(AssortmentPermission)

public void SaveAssortmentPermission(AssortmentPermission assortmentPermission)

Parameters

assortmentPermission AssortmentPermission
The assortment permission object.

SaveAssortmentRelation(AssortmentRelation)

public void SaveAssortmentRelation(AssortmentRelation assortmentRelation)

Parameters

assortmentRelation AssortmentRelation
The assortment relation object.
To top