Esempio n. 1
0
        private IList <MDItemEntity> GetILFromCache()
        {
            IList <MDItemEntity> lstItemCategory;

            if (HttpContext.Current.Cache[CommonConstants.ITEM_FC] == null)
            {
                // collecting form database
                String fe = SqlExpressionBuilder.PrepareFilterExpression(MDItemEntity.FLD_NAME_IsRemoved, "false", SQLMatchType.Equal);
                lstItemCategory = DataAccessFactory.CreateMDItemDataAccess().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                // storing in the cache
                if (lstItemCategory != null)
                {
                    HttpContext.Current.Cache[CommonConstants.ITEM_FC] = lstItemCategory;
                }
            }
            else
            {
                lstItemCategory = (IList <MDItemEntity>)HttpContext.Current.Cache[CommonConstants.ITEM_FC];
            }

            return(lstItemCategory);
        }