Update README.md

This commit is contained in:
sunkaixuan 2019-04-29 20:50:03 +08:00 committed by GitHub
parent 89522bcb67
commit 616ef51eb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,6 +73,7 @@ public class Student
We use it to query
```cs
//easy
var getAll = db.Queryable<Student>().ToList();
var getAllNoLock = db.Queryable<Student>().With(SqlWith.NoLock).ToList();
var getByPrimaryKey = db.Queryable<Student>().InSingle(2);
@ -88,7 +89,8 @@ var group = db.Queryable<Student>().GroupBy(it => it.Id).Select(it =>new { id =
var page = db.Queryable<Student>().ToPageList(pageIndex, pageSize, ref totalCount);
//page join
var pageJoin = db.Queryable<Student, School>((st, sc) =>new JoinQueryInfos(JoinType.Left,st.SchoolId==sc.Id)).ToPageList(pageIndex, pageSize, ref totalCount);
var pageJoin = db.Queryable<Student, School>((st, sc) =>new JoinQueryInfos(JoinType.Left,st.SchoolId==sc.Id))
.ToPageList(pageIndex, pageSize, ref totalCount);
//top 5
var top5 = db.Queryable<Student>().Take(5).ToList();