mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-25 01:14:33 +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();
|
int personId = db.Insertable(person).ExecuteReturnIdentity();
|
||||||
|
|
||||||
var list = db.Queryable<UnitAddress011>().Includes(x => x.Persons).Includes(x=>x.City).ToList();
|
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)
|
db.UpdateNav(list)
|
||||||
.IncludeByNameString("Persons")
|
.IncludeByNameString("Persons")
|
||||||
.IncludeByNameString("City").ExecuteCommand();
|
.IncludeByNameString("City").ExecuteCommand();
|
||||||
|
Loading…
Reference in New Issue
Block a user