From 3f7ca0cf876d4bb1ec0ba1683b9ed7b0f5429c64 Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Mon, 15 Jun 2020 15:52:35 +0800 Subject: [PATCH] Use ToListAsync then convert to Array. --- .../Volo/Abp/MongoDB/MongoDbAsyncQueryableProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoDbAsyncQueryableProvider.cs b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoDbAsyncQueryableProvider.cs index a2bca09bdc..206c4add39 100644 --- a/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoDbAsyncQueryableProvider.cs +++ b/framework/src/Volo.Abp.MongoDB/Volo/Abp/MongoDB/MongoDbAsyncQueryableProvider.cs @@ -346,9 +346,9 @@ namespace Volo.Abp.MongoDB return GetMongoQueryable(queryable).ToListAsync(cancellationToken); } - public Task ToArrayAsync(IQueryable queryable, CancellationToken cancellationToken = default) + public async Task ToArrayAsync(IQueryable queryable, CancellationToken cancellationToken = default) { - return Task.FromResult(GetMongoQueryable(queryable).ToArray()); + return (await GetMongoQueryable(queryable).ToListAsync(cancellationToken)).ToArray(); } } }