Exemplo n.º 1
0
        /// <summary>
        /// Gets all topics
        /// </summary>
        /// <returns>topic collection</returns>
        public static TopicCollection GetAllTopics()
        {
            DBTopicCollection dbCollection = DBProviderManager <DBTopicProvider> .Provider.GetAllTopics();

            TopicCollection collection = DBMapping(dbCollection);

            return(collection);
        }
Exemplo n.º 2
0
        private static TopicCollection DBMapping(DBTopicCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            TopicCollection collection = new TopicCollection();
            foreach (DBTopic dbItem in dbCollection)
            {
                Topic item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets all topics
        /// </summary>
        /// <returns>Topic collection</returns>
        public override DBTopicCollection GetAllTopics()
        {
            var       result    = new DBTopicCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_TopicLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    var item = GetTopicFromReader(dataReader);
                    result.Add(item);
                }
            }
            return(result);
        }
Exemplo n.º 4
0
        private static TopicCollection DBMapping(DBTopicCollection dbCollection)
        {
            if (dbCollection == null)
            {
                return(null);
            }

            var collection = new TopicCollection();

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

            return(collection);
        }