Example #1
0
        /// <summary>
        /// get the collection of all items, sorted by the provided index.
        /// </summary>
        /// <param name="ascending"></param>
        /// <returns></returns>
        public ValueCollection <TKey, TValue> ItemCollection(string indexFieldOrPropertyName, bool ascending)
        {
            IIndex <TValue> index = this.Indexes.getIndex(indexFieldOrPropertyName);

            ValueCollection <TKey, TValue> collection = new ValueCollection <TKey, TValue>(this, index.AllItems(ascending).GetEnumerator());

            return(collection);
        }
Example #2
0
        /// <summary>
        /// get the collection of all items, sorted by primary key.
        /// Warning, Thread-unsafe. used in a multithread sitaution is not guarantee.
        /// </summary>
        /// <param name="ascending"></param>
        /// <returns></returns>
        public ValueCollection <TKey, TValue> ItemCollection(bool ascending = true)
        {
            ValueCollection <TKey, TValue> collection = new ValueCollection <TKey, TValue>(this, this.primaryIndex.allItemCollection(ascending).GetEnumerator());

            return(collection);
        }