/// <summary>
        /// Finds all object instances specified by their primary keys.
        /// </summary>
        /// <returns>A task that completes with a dictionary mapping the primary key to its value if found in the database.</returns>
        /// <param name="This">The database connection.</param>
        /// <param name="primaryKeys">An IEnumerable of primary keys to find.</param>
        /// <param name="resultSelector">A transform function to apply to each row.</param>
        /// <typeparam name="T">The mapped type.</typeparam>
        public static Task <IReadOnlyDictionary <long, T> > FindAllAsync <T>(
            this IAsyncDatabaseConnection This,
            IEnumerable <long> primaryKeys,
            Func <IReadOnlyList <IResultSetValue>, T> resultSelector)
        {
            Contract.Requires(This != null);
            Contract.Requires(primaryKeys != null);
            Contract.Requires(resultSelector != null);

            return(This.FindAllAsync(primaryKeys, resultSelector, CancellationToken.None));
        }