Exemple #1
0
        /// <summary>
        /// Executes the specified SQL command text and runs a custom delegate
        /// to process the results.
        /// </summary>
        /// <typeparam name="T">Result type.</typeparam>
        /// <param name="context">A SQL command context which includes a SELECT command.</param>
        /// <param name="valueProvider">Custom delegate to create the result.</param>
        /// <returns>The result of the SQL command.</returns>
        internal T ExecuteCustom <T>(IContext context, CreateEntity <T> valueProvider)
        {
            var processor = new CustomResultProcessor <T>(valueProvider);

            return(RunCommand <T>(context, processor));
        }
Exemple #2
0
        /// <summary>
        /// Executes the specified SQL command text and runs a custom delegate
        /// to process the results.
        /// </summary>
        /// <typeparam name="T">Result type.</typeparam>
        /// <param name="context">A SQL command context which includes a SELECT command.</param>
        /// <param name="valueProvider">Custom delegate to create the result.</param>
        /// <param name="cancel">A token to monitor for cancellation requests.</param>
        /// <returns>The result of the SQL command.</returns>
        internal Task <T> ExecuteCustomAsync <T>(IContext context, CreateEntity <T> valueProvider, CancellationToken cancel)
        {
            var processor = new CustomResultProcessor <T>(valueProvider);

            return(RunCommandAsync <T>(context, processor, cancel));
        }