Class FavoriteListService
- Assembly
- Dynamicweb.Ecommerce.dll
public class FavoriteListService : ICacheStorage<int, List<FavoriteList>>, ICacheStorage<int>, ICacheStorage
- Inheritance
-
FavoriteListService
- Implements
- Inherited Members
Methods
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public void ClearCache()
ClearCache(IEnumerable<int>)
Resets the specified keys to the default value for objects stored in the object cache
public void ClearCache(IEnumerable<int> keys)
Parameters
keysIEnumerable<int>- Keys to reset
ClearCache(int)
Resets the specified key to the default value for objects stored in the object cache
public void ClearCache(int key)
Parameters
keyint- Key to reset
CreateFavoriteList(int, string)
Create a New favorite list with the provided name, And assign it to the current user.
public FavoriteList CreateFavoriteList(int userId, string name)
Parameters
Returns
CreateFavoriteList(int, string, bool)
Create a New favorite list with the provided name, And assign it to the current user.
public FavoriteList CreateFavoriteList(int userId, string name, bool isDefault)
Parameters
userIdint- The id of user
namestring- The name for a new favorite list
isDefaultbool- Is default favorite list created or not
Returns
Delete(FavoriteList)
Deletes the customer product list
public void Delete(FavoriteList list)
Parameters
listFavoriteList- The customer product list.
GetListById(int, int)
Gets the favorite list by user id.
public FavoriteList GetListById(int userId, int favoriteListId)
Parameters
Returns
- FavoriteList
- The favorites list
GetLists(int)
Gets the favorites list by user id.
public IEnumerable<FavoriteList> GetLists(int userId)
Parameters
userIdint- The id of user
Returns
- IEnumerable<FavoriteList>
- The favorites list
RemoveFavoriteList(int, int)
Delete the favorite list if it belongs to the current user and all the favorite list products.
If the favorite list doesn't belong to the user, we shouldn't do anything.
public void RemoveFavoriteList(int userId, int favoriteListId)
Parameters
RenameFavoriteList(int, int, string)
Rename the favorite list if it belongs to the current user,
If the favorite list doesn't belong to the user, we shouldn't do anything.
public void RenameFavoriteList(int userId, int favoriteListId, string name)
Parameters
userIdint- The id of user
favoriteListIdint- The identifier of a favorite list
namestring- The new name for a favorite list
Save(FavoriteList)
Saves the favorite product list.
public void Save(FavoriteList list)
Parameters
listFavoriteList- The favorite product list.