public static ProductImage Load(Int32 productImageId, bool useCache) { if (productImageId == 0) { return(null); } ProductImage productImage = null; string key = "ProductImage_" + productImageId.ToString(); if (useCache) { productImage = ContextCache.GetObject(key) as ProductImage; if (productImage != null) { return(productImage); } } productImage = new ProductImage(); if (productImage.Load(productImageId)) { if (useCache) { ContextCache.SetObject(key, productImage); } return(productImage); } return(null); }
public static bool Delete(Int32 productImageId) { ProductImage productImage = new ProductImage(); if (productImage.Load(productImageId)) { return(productImage.Delete()); } return(false); }