コード例 #1
0
        /// <summary>
        /// Executes the specified SQL command text and bind the selected rows to
        /// a dictionary from the first two columns of the results.
        /// </summary>
        /// <typeparam name="TKey">The key type.</typeparam>
        /// <typeparam name="TValue">The key type.</typeparam>
        /// <param name="context">A SQL command context which includes a SELECT command.</param>
        /// <returns>The result of the SQL command.</returns>
        internal IDictionary <TKey, TValue> ExecuteRowKeyedDictionaryResult <TKey, TValue>(IContext context)
        {
            var processor = new RowKeyedDictionaryResultProcessor <TKey, TValue>();

            return(RunCommand <IDictionary <TKey, TValue> >(context, processor));
        }
コード例 #2
0
        /// <summary>
        /// Executes the specified SQL command text and bind the selected rows to
        /// a dictionary from the first two columns of the results.
        /// </summary>
        /// <typeparam name="TKey">The key type.</typeparam>
        /// <typeparam name="TValue">The key type.</typeparam>
        /// <param name="context">A SQL command context which includes a SELECT command.</param>
        /// <param name="cancel">A token to monitor for cancellation requests.</param>
        /// <returns>The result of the SQL command.</returns>
        internal Task <IDictionary <TKey, TValue> > ExecuteRowKeyedDictionaryResultAsync <TKey, TValue>(IContext context, CancellationToken cancel)
        {
            var processor = new RowKeyedDictionaryResultProcessor <TKey, TValue>();

            return(RunCommandAsync <IDictionary <TKey, TValue> >(context, processor, cancel));
        }