<commit_before>using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using GraphQL.DataLoader;

namespace OrchardCore.Apis.GraphQL
{
    public static class DataLoaderExtensions
    {
        public static Task<T[]> LoadAsync<TKey, T>(this IDataLoader<TKey, T> dataLoader, IEnumerable<TKey> keys)
        {
            var tasks = new List<Task<T>>();

            foreach (var key in keys)
            {
                tasks.Add(dataLoader.LoadAsync(key));
            }

            return Task.WhenAll(tasks);
        }

        public static Task<T[]> LoadAsync<TKey, T>(this IDataLoader<TKey, T> dataLoader, params TKey[] keys)
        {
            return dataLoader.LoadAsync(keys.AsEnumerable());
        }
    }
}
<commit_msg>Non awaited task in GraphQL DataLoaderExtensions (#11536)<commit_after>using System.Collections.Generic;
using System.Threading.Tasks;
using GraphQL.DataLoader;

namespace OrchardCore.Apis.GraphQL
{
    public static class DataLoaderExtensions
    {
        public static Task<T[]> LoadAsync<TKey, T>(this IDataLoader<TKey, T> dataLoader, IEnumerable<TKey> keys)
        {
            var tasks = new List<Task<T>>();

            foreach (var key in keys)
            {
                tasks.Add(dataLoader.LoadAsync(key));
            }

            return Task.WhenAll(tasks);
        }

        public static async Task<T[]> LoadAsync<TKey, T>(this IDataLoader<TKey, T> dataLoader, params TKey[] keys)
        {
            var tasks = new T[keys.Length];
            for (var i = 0; i < keys.Length; i++)
            {
                tasks[i] = await dataLoader.LoadAsync(keys[i]);
            }

            return tasks;
        }
    }
}

{'fraction_non_alphanumeric': 0.10864485981308411, 'fraction_numerical': 0.0035046728971962616, 'mean_word_length': 2.166358595194085, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5016579', 'n_tokens_mistral': 510, 'n_tokens_neox': 493, 'n_words': 117}