Add ForEachAsync

This commit is contained in:
sunkaixuan
2022-04-13 01:03:43 +08:00
parent 293780246f
commit 80ededd501
4 changed files with 39 additions and 5 deletions

View File

@@ -91,10 +91,16 @@ namespace OrmTest
db.Insertable(new Tree1() { Id = 4, Name = "02" }).ExecuteCommand();
db.Insertable(new Tree1() { Id = 5, Name = "0201", ParentId = 2 }).ExecuteCommand();
db.Insertable(new Tree1() { Id = 6, Name = "020101", ParentId = 5 }).ExecuteCommand();
var list4=db.Queryable<Tree1>()
.Includes(it => it.Child,it=>it.Child,it=>it.Child)
.Includes(it => it.Parent,it=>it.Parent, it => it.Parent, it => it.Parent)
.ToList();
var list21111 = new List<Tree1>();
db.Queryable<Tree1>()
.Includes(it => it.Child)
.Includes(it => it.Parent)
.ForEach(item => {
list21111.Add(item);
}, 2);
//var json = db.Utilities.SerializeObject(list4);
db.CodeFirst.InitTables<UnitA001, UnitA002>();