Ejemplo n.º 1
0
        /// <summary>
        /// Add a dataset to the cache
        /// </summary>
        /// <param name="dataSet">The dataset</param>
        /// <param name="name">A name for the dataset used to retrieve it later</param>
        /// <param name="queryCriteria">The criteria used to create the dataset.
        /// This is used so that later when you retrieve the dataset you only get
        /// it back if it has the same criteria</param>
        public void Add(DataSet dataSet, string name, string queryCriteria)
        {
            lock (_caches)
                if (_caches.ContainsKey(name))
                {
                    _caches.Remove(name);
                }

            DataSetCache dataSetCache = new DataSetCache();

            dataSetCache.DataSet       = dataSet;
            dataSetCache.QueryCriteria = queryCriteria;

            lock (_caches)
                _caches.Add(name, dataSetCache);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a dataset to the cache
        /// </summary>
        /// <param name="dataSet">The dataset</param>
        /// <param name="name">A name for the dataset used to retrieve it later</param>
        /// <param name="queryCriteria">The criteria used to create the dataset.  
        /// This is used so that later when you retrieve the dataset you only get
        /// it back if it has the same criteria</param>
        public void Add(DataSet dataSet, string name, string queryCriteria)
        {
            lock (_caches)
                if (_caches.ContainsKey(name))
                {
                    _caches.Remove(name);
                }

            DataSetCache dataSetCache = new DataSetCache();

            dataSetCache.DataSet = dataSet;
            dataSetCache.QueryCriteria = queryCriteria;

            lock (_caches)
                _caches.Add(name, dataSetCache);
        }