From 905ac52e92ca421aaacc4390c3cebd0a4f0c142e Mon Sep 17 00:00:00 2001 From: 2881099 <2881099@users.noreply.github.com> Date: Thu, 24 Apr 2025 19:17:47 +0800 Subject: [PATCH] Updated Return Data (markdown) --- Return-Data.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Return-Data.md b/Return-Data.md index 3aa7c49..cd1de76 100644 --- a/Return-Data.md +++ b/Return-Data.md @@ -149,13 +149,19 @@ Dto query only maps default fields (common attributes). For mapping objects, ple Execute queries and return data in blocks, which can reduce memory overhead. For example, if 100,000 pieces of data are read, 100 pieces of data are returned for processing each time. ```csharp -var testlist1 = fsql.Select().OrderBy(a => a.Id).ToList(); -var testlist2 = new List(); -fsql.Select().OrderBy(a => a.Id).ToChunk(100, done => { - testlist2.AddRange(done.Object); - //done.IsBreak = true; v1.7.0 stop reading +fsql.Select().OrderBy(a => a.Id).ToChunk(100, done => +{ + List list = done.Object; + //done.IsBreak = true; v1.7.0 停止读取 }); -//Here is a demonstration that the final data returned by testlist1 and testlist2 are the same. + +//VNext +var asyncEnum = fsql.Select().OrderBy(a => a.Id).ToChunkAsyncEnumerable(100); +await foreach (var items in asyncEnum) +{ + foreach (var item in items) + Console.WriteLine(item.Nickname); +} ``` ## ToSql