private static MeasureDimensionCollection DBMapping(DBMeasureDimensionCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            MeasureDimensionCollection collection = new MeasureDimensionCollection();
            foreach (DBMeasureDimension dbItem in dbCollection)
            {
                MeasureDimension item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }
        private static MeasureDimensionCollection DBMapping(DBMeasureDimensionCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new MeasureDimensionCollection();

            foreach (var dbItem in dbCollection)
            {
                var item = DBMapping(dbItem);
                collection.Add(item);
            }

            return(collection);
        }
        /// <summary>
        /// Gets all measure dimensions
        /// </summary>
        /// <returns>Measure dimension collection</returns>
        public override DBMeasureDimensionCollection GetAllMeasureDimensions()
        {
            var       result    = new DBMeasureDimensionCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_MeasureDimensionLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetMeasureDimensionFromReader(dataReader);
                    result.Add(item);
                }
            }

            return(result);
        }
        /// <summary>
        /// Gets all measure dimensions
        /// </summary>
        /// <returns>Measure dimension collection</returns>
        public static MeasureDimensionCollection GetAllMeasureDimensions()
        {
            string key  = MEASUREDIMENSIONS_ALL_KEY;
            object obj2 = NopCache.Get(key);

            if (MeasureManager.CacheEnabled && (obj2 != null))
            {
                return((MeasureDimensionCollection)obj2);
            }

            DBMeasureDimensionCollection dbCollection = DBProviderManager <DBMeasureProvider> .Provider.GetAllMeasureDimensions();

            MeasureDimensionCollection measureDimensionCollection = DBMapping(dbCollection);

            if (MeasureManager.CacheEnabled)
            {
                NopCache.Max(key, measureDimensionCollection);
            }
            return(measureDimensionCollection);
        }
        /// <summary>
        /// Gets all measure dimensions
        /// </summary>
        /// <returns>Measure dimension collection</returns>
        public override DBMeasureDimensionCollection GetAllMeasureDimensions()
        {

            DBMeasureDimensionCollection measureDimensionCollection = new DBMeasureDimensionCollection();
            Database db = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_MeasureDimensionLoadAll");
            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBMeasureDimension measureDimension = GetMeasureDimensionFromReader(dataReader);
                    measureDimensionCollection.Add(measureDimension);
                }
            }

            return measureDimensionCollection;
        }