Example #1
0
        public static ProductitemInfo GetItem(uint Id)
        {
            if (itemCacheTimeout <= 0)
            {
                return(Select.WhereId(Id).ToOne());
            }
            string key   = string.Concat("pifa_BLL_Productitem_", Id);
            string value = RedisHelper.Get(key);

            if (!string.IsNullOrEmpty(value))
            {
                try { return(ProductitemInfo.Parse(value)); } catch { }
            }
            ProductitemInfo item = Select.WhereId(Id).ToOne();

            if (item == null)
            {
                return(null);
            }
            RedisHelper.Set(key, item.Stringify(), itemCacheTimeout);
            return(item);
        }