mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-05 17:37:58 +08:00
Add demo
This commit is contained in:
parent
bf95ccb90d
commit
31508c89ee
@ -31,6 +31,25 @@ namespace OrmTest
|
||||
int personId = db.Insertable(person).ExecuteReturnIdentity();
|
||||
|
||||
var list = db.Queryable<UnitAddress011>().Includes(x => x.Persons).Includes(x=>x.City).ToList();
|
||||
|
||||
|
||||
var list2 = db.Queryable<UnitAddress011>()
|
||||
.Includes(x => x.Persons)
|
||||
.IncludeLeftJoin(x => x.City)
|
||||
.Select(it=>new {
|
||||
City=new {it.City.Name,it.City.Id },
|
||||
Persons = it.Persons
|
||||
}).ToList();
|
||||
|
||||
var list3 = db.Queryable<UnitAddress011>()
|
||||
.Includes(x => x.Persons)
|
||||
.Includes(x => x.City)
|
||||
.Select(it => new {
|
||||
City = new { it.City.Name, it.City.Id },
|
||||
Persons = it.Persons
|
||||
}).ToList();
|
||||
|
||||
|
||||
db.UpdateNav(list)
|
||||
.IncludeByNameString("Persons")
|
||||
.IncludeByNameString("City").ExecuteCommand();
|
||||
|
Loading…
Reference in New Issue
Block a user