public static Wishlist Load(Int32 wishlistId, bool useCache) { if (wishlistId == 0) { return(null); } Wishlist wishlist = null; string key = "Wishlist_" + wishlistId.ToString(); if (useCache) { wishlist = ContextCache.GetObject(key) as Wishlist; if (wishlist != null) { return(wishlist); } } wishlist = new Wishlist(); if (wishlist.Load(wishlistId)) { if (useCache) { ContextCache.SetObject(key, wishlist); } return(wishlist); } return(null); }
public static bool Delete(Int32 wishlistId) { Wishlist wishlist = new Wishlist(); if (wishlist.Load(wishlistId)) { return(wishlist.Delete()); } return(false); }