예제 #1
0
        /// <summary>
        /// Get MProduct from Cache
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="M_Product_ID">id</param>
        /// <returns>MProduct</returns>
        public static MProduct Get(Ctx ctx, int M_Product_ID)
        {
            int      key      = M_Product_ID;
            MProduct retValue = (MProduct)s_cache[key];

            if (retValue != null)
            {
                return(retValue);
            }
            retValue = new MProduct(ctx, M_Product_ID, null);
            if (retValue.Get_ID() != 0)
            {
                s_cache.Add(key, retValue);
            }
            return(retValue);
        }