Пример #1
0
        public async Task <string> GetWithStackedDataLoader(
            string key,
            [DataLoader("fooBar")] TestDataLoader testDataLoader,
            CancellationToken cancellationToken)
        {
            var s = await testDataLoader.LoadAsync(key + "a", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "b", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "c", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "d", cancellationToken);

            await Task.Delay(10, cancellationToken);

            s += await testDataLoader.LoadAsync(key + "e", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "f", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "g", cancellationToken);

            await Task.Delay(10, cancellationToken);

            s += await testDataLoader.LoadAsync(key + "h", cancellationToken);

            return(s);
        }
Пример #2
0
 public Task <string> GetWithDataLoader(
     string key,
     FieldNode fieldSelection,
     [DataLoader] TestDataLoader testDataLoader,
     CancellationToken cancellationToken)
 {
     return(testDataLoader.LoadAsync(key, cancellationToken));
 }
Пример #3
0
        public async Task <string> GetWithStackedDataLoader(
            string key,
            FieldNode fieldSelection,
            [DataLoader("fooBar")] TestDataLoader testDataLoader,
            CancellationToken cancellationToken)
        {
            string s = await testDataLoader.LoadAsync(key + "a", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "b", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "c", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "d", cancellationToken);

            s += await testDataLoader.LoadAsync(key + "e", cancellationToken);

            return(s);
        }