From 43b1b67d85ef3660b2cfbcf38c4a38a736928abf Mon Sep 17 00:00:00 2001 From: "610262374@qq.com" <610262374@qq.com> Date: Sat, 11 Mar 2017 10:28:33 +0800 Subject: [PATCH] - --- OrmTest/UnitTest/Query/SelectQuery.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OrmTest/UnitTest/Query/SelectQuery.cs b/OrmTest/UnitTest/Query/SelectQuery.cs index c38ea964b..5d03ed0e5 100644 --- a/OrmTest/UnitTest/Query/SelectQuery.cs +++ b/OrmTest/UnitTest/Query/SelectQuery.cs @@ -34,21 +34,21 @@ namespace OrmTest.UnitTest { Console.WriteLine(sql+" " + pars); }; - //var list = db.Queryable() + var list = db.Queryable() + .Where(st => st.Id > 0) + .Select(it => new ViewModelStudent { Name = it.Name }).ToList(); - // .Where(st => st.Id > 0) - // .Select(it => new ViewModelStudent { Name = it.Name }).ToList(); - //var list2 = db.Queryable() - // .Where(st => st.Id > 0) - // .Select("id").ToList(); + var list2 = db.Queryable() + .Where(st => st.Id > 0) + .Select("id").ToList(); - var list = db.Queryable((st, sc,sc2) => new object[] { + var list3 = db.Queryable((st, sc,sc2) => new object[] { JoinType.Left,st.SchoolId==sc.Id, JoinType.Left,sc2.Id==sc.Id }).Where(st => st.Id > 0) .Select((st) =>new School() { Id=st.Id}).ToList(); - var list3 = db.Queryable("Student", "st") + var list4 = db.Queryable("Student", "st") .AddJoinInfo("School", "sh", "sh.id=st.schoolid") .Where("st.id>@id") .AddParameters(new {id=1})