Пример #1
0
        public static Readme Load(Int32 readmeId, bool useCache)
        {
            if (readmeId == 0)
            {
                return(null);
            }
            Readme readme = null;
            string key    = "Readme_" + readmeId.ToString();

            if (useCache)
            {
                readme = ContextCache.GetObject(key) as Readme;
                if (readme != null)
                {
                    return(readme);
                }
            }
            readme = new Readme();
            if (readme.Load(readmeId))
            {
                if (useCache)
                {
                    ContextCache.SetObject(key, readme);
                }
                return(readme);
            }
            return(null);
        }
Пример #2
0
        public static bool Delete(Int32 readmeId)
        {
            Readme readme = new Readme();

            if (readme.Load(readmeId))
            {
                return(readme.Delete());
            }
            return(false);
        }