- 增加 ISelect.ToChunk 实现分块查询数据,减少数据过大时内存占用;

This commit is contained in:
28810
2019-09-10 16:01:01 +08:00
parent e0a23accb0
commit 564e1951d8
4 changed files with 99 additions and 0 deletions

View File

@ -48,6 +48,12 @@ namespace orm_vs
static void Main(string[] args)
{
var testlist1 = fsql.Select<Song>().OrderBy(a => a.Id).ToList();
var testlist2 = new List<Song>();
fsql.Select<Song>().OrderBy(a => a.Id).ToChunk(0, list =>
{
testlist2.AddRange(list);
});
fsql.CodeFirst.SyncStructure(typeof(Song), typeof(Song_tag), typeof(Tag));
//sugar.CodeFirst.InitTables(typeof(Song), typeof(Song_tag), typeof(Tag));