Table of Contents

Class UserExtensions

Namespace
Dynamicweb.Ecommerce.CustomerExperienceCenter.Favorites
Assembly
Dynamicweb.Ecommerce.dll

The class UserExtensions represents shared member providing user extensions.

public static class UserExtensions
Inheritance
UserExtensions
Inherited Members

Methods

GetFavoriteListById(User, int)

Gets a FavoriteList with specified identifier if it belonging to the current user />

public static FavoriteList GetFavoriteListById(this User user, int favoriteListId)

Parameters

user User

The current user

favoriteListId int

The identifier of a favorite list

Returns

FavoriteList

Remarks

Returns the null value if favorite list doesn't belong to current user.

GetFavoriteLists(User)

Gets a IEnumerable<T> of all FavoriteLists belonging to the current user />

public static IEnumerable<FavoriteList> GetFavoriteLists(this User user)

Parameters

user User

The current user

Returns

IEnumerable<FavoriteList>

IsProductInAnyFavoriteList(User, string)

Checks if the provided ProductId exists in any of the favorite lists, which belongs to the current user. This means that it checks for both master And variants in all the favorite lists.

public static bool IsProductInAnyFavoriteList(this User user, string productId)

Parameters

user User

The current user

productId string

The product identifier

Returns

bool

IsProductInAnyFavoriteList(User, string, string)

Checks if the specific variant (Or master if the variantId Is empty), exists in any favorite list, which belongs to the current user.

public static bool IsProductInAnyFavoriteList(this User user, string productId, string variantId)

Parameters

user User

The current user

productId string

The product identifier

variantId string

The product variant identifier

Returns

bool

IsProductInFavoriteList(User, int, string)

Checks if the provided ProductId exists in the favorite list, which matches the FavoriteListId. This means that it checks for both master And variants in all the favorite lists.

public static bool IsProductInFavoriteList(this User user, int favoriteListId, string productId)

Parameters

user User

The current user

favoriteListId int

The identifier of a favorite list

productId string

The product identifier

Returns

bool

IsProductInFavoriteList(User, int, string, string)

Checks if the specific variant (Or master if the variantId Is empty) exists in the favorite list, which matches the FavoriteListId.

public static bool IsProductInFavoriteList(this User user, int favoriteListId, string productId, string variantId)

Parameters

user User

The current user

favoriteListId int
productId string

The product identifier

variantId string

The product variant identifier

Returns

bool
To top