public static CustomUrl Load(Int32 customUrlId, bool useCache) { if (customUrlId == 0) { return(null); } CustomUrl customUrl = null; string key = "CustomUrl_" + customUrlId.ToString(); if (useCache) { customUrl = ContextCache.GetObject(key) as CustomUrl; if (customUrl != null) { return(customUrl); } } customUrl = new CustomUrl(); if (customUrl.Load(customUrlId)) { if (useCache) { ContextCache.SetObject(key, customUrl); } return(customUrl); } return(null); }
public static bool Delete(Int32 customUrlId) { CustomUrl customUrl = new CustomUrl(); if (customUrl.Load(customUrlId)) { return(customUrl.Delete()); } return(false); }