diff --git a/README.md b/README.md index f5f7b4c55..802e581f9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ var getByFuns = db.Queryable().Where(it => NBORM.IsNullOrEmpty(it.Name)).ToList(); ``` -###1.3 Page +### 1.3 Page ```c var pageIndex = 1; var pageSize = 2; @@ -36,3 +36,30 @@ var top5 = db.Queryable().Take(5).ToList(); //skip5 var skip5 = db.Queryable().Skip(5).ToList(); ``` + +### 1.4 Join +```c +//join 2 +var list = db.Queryable((st, sc) => new object[] { +JoinType.Left,st.SchoolId==sc.Id +}).ToList(); + +//join 3 +var list2 = db.Queryable((st, sc,st2) => new object[] { +JoinType.Left,st.SchoolId==sc.Id, +JoinType.Left,st.SchoolId==st2.Id +}).ToList(); + +//join return List +var list3 = db.Queryable((st, sc) => new object[] { +JoinType.Left,st.SchoolId==sc.Id +}).Select((st,sc)=>new ViewModelStudent { Name= st.Name,SchoolId=sc.Id }).ToList(); + +//join Order By (order by st.id desc,sc.id desc) +var list4 = db.Queryable((st, sc) => new object[] { +JoinType.Left,st.SchoolId==sc.Id +}) +.OrderBy(st=>st.Id,OrderByType.Desc) +.OrderBy(sc=>sc.Id,OrderByType.Desc) +.Select((st, sc) => new ViewModelStudent { Name = st.Name, SchoolId = sc.Id }).ToList(); +```