Esempio n. 1
0
        /// <summary>
        /// Gets all of the records that match a given query in the specified index.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="count"></param>
        /// <typeparam name="TKey"></typeparam>
        /// <typeparam name="TResult"></typeparam>
        /// <returns></returns>
        public async Task <List <TResult> > GetAllKeys <TKey, TResult>(IDBKeyRange <TKey> key, int?count = null)
        {
            await _idbDatabase.EnsureIsOpen();

            return(await _idbDatabase.CallJavascript <List <TResult> >(DbFunctions.GetAllKeysFromIndexByKeyRange, _idbStore.Name, Name, key.Lower, key.Upper, key.LowerOpen, key.UpperOpen, count));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets all of the records using a filter expression
        /// </summary>
        /// <param name="filter">expresion that evaluates to true/false, each record es passed to "obj" parameter</param>
        /// <param name="key"></param>
        /// <param name="count"></param>
        /// <param name="skip"></param>
        /// <typeparam name="TKey"></typeparam>
        /// <typeparam name="TResult"></typeparam>
        /// <returns></returns>
        public async Task <List <TResult> > Query <TKey, TResult>(string filter, IDBKeyRange <TKey> key, int?count = null, int?skip = null)
        {
            await _idbDatabase.EnsureIsOpen();

            return(await _idbDatabase.CallJavascript <List <TResult> >(DbFunctions.QueryFromIndex, _idbStore.Name, Name, key, filter, count, skip));
        }
Esempio n. 3
0
        /// <summary>
        /// Count records in Index
        /// </summary>
        /// <param name="key"></param>
        /// <typeparam name="TKey"></typeparam>
        /// <returns></returns>
        public async Task <int> Count <TKey>(IDBKeyRange <TKey> key)
        {
            await _idbDatabase.EnsureIsOpen();

            return(await _idbDatabase.CallJavascript <int>(DbFunctions.CountFromIndexByKeyRange, _idbStore.Name, Name, key.Lower, key.Upper, key.LowerOpen, key.UpperOpen));
        }