Updated Return Data (markdown)

2881099
2025-04-24 19:17:47 +08:00
parent b06785c4b4
commit 905ac52e92

@@ -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<Song>().OrderBy(a => a.Id).ToList();
var testlist2 = new List<Song>();
fsql.Select<Song>().OrderBy(a => a.Id).ToChunk(100, done => {
testlist2.AddRange(done.Object);
//done.IsBreak = true; v1.7.0 stop reading
fsql.Select<Song>().OrderBy(a => a.Id).ToChunk(100, done =>
{
List<Song> 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<Song>().OrderBy(a => a.Id).ToChunkAsyncEnumerable(100);
await foreach (var items in asyncEnum)
{
foreach (var item in items)
Console.WriteLine(item.Nickname);
}
```
## ToSql