果糖网
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
3 deletions
-
README.md
|
@ -59,23 +59,24 @@ WHERE |
|
|
``` |
|
|
``` |
|
|
### Feature2 :Include Query、Insert、Delete and Update |
|
|
### Feature2 :Include Query、Insert、Delete and Update |
|
|
```cs |
|
|
```cs |
|
|
|
|
|
//query by nav |
|
|
var list=db.Queryable<Test>() |
|
|
var list=db.Queryable<Test>() |
|
|
.Includes(x => x.Provinces,x=>x.Citys ,x=>x.Street) //multi-level |
|
|
.Includes(x => x.Provinces,x=>x.Citys ,x=>x.Street) //multi-level |
|
|
.Includes(x => x.ClassInfo) |
|
|
.Includes(x => x.ClassInfo) |
|
|
.ToList(); |
|
|
.ToList(); |
|
|
|
|
|
//insert by nav |
|
|
db.InsertNav(list) //Finer operation than EFCore's SaveChange |
|
|
db.InsertNav(list) //Finer operation than EFCore's SaveChange |
|
|
.Include(z1 => z1.SchoolA) |
|
|
.Include(z1 => z1.SchoolA) |
|
|
.ThenInclude(z1 => z1.RoomList) |
|
|
.ThenInclude(z1 => z1.RoomList) |
|
|
.Include(z1 => z1.Books) |
|
|
.Include(z1 => z1.Books) |
|
|
.ExecuteCommand(); |
|
|
.ExecuteCommand(); |
|
|
|
|
|
//delete by nav |
|
|
db.DeleteNav<Student>(it=>it.Id==1) |
|
|
db.DeleteNav<Student>(it=>it.Id==1) |
|
|
.Include(z1 => z1.SchoolA) |
|
|
.Include(z1 => z1.SchoolA) |
|
|
.ThenInclude(z1 => z1.RoomList) st |
|
|
.ThenInclude(z1 => z1.RoomList) st |
|
|
.Include(z1 => z1.Books) |
|
|
.Include(z1 => z1.Books) |
|
|
.ExecuteCommand(); |
|
|
.ExecuteCommand(); |
|
|
|
|
|
//update by nav |
|
|
db.UpdateNav(list) |
|
|
db.UpdateNav(list) |
|
|
.Include(z1 => z1.SchoolA) |
|
|
.Include(z1 => z1.SchoolA) |
|
|
.ThenInclude(z1 => z1.RoomList) |
|
|
.ThenInclude(z1 => z1.RoomList) |
|
|