mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-20 02:29:39 +08:00
-
This commit is contained in:
@@ -34,21 +34,21 @@ namespace OrmTest.UnitTest
|
|||||||
{
|
{
|
||||||
Console.WriteLine(sql+" " + pars);
|
Console.WriteLine(sql+" " + pars);
|
||||||
};
|
};
|
||||||
//var list = db.Queryable<Student>()
|
var list = db.Queryable<Student>()
|
||||||
|
.Where(st => st.Id > 0)
|
||||||
|
.Select(it => new ViewModelStudent { Name = it.Name }).ToList();
|
||||||
|
|
||||||
// .Where(st => st.Id > 0)
|
var list2 = db.Queryable<Student>()
|
||||||
// .Select(it => new ViewModelStudent { Name = it.Name }).ToList();
|
.Where(st => st.Id > 0)
|
||||||
//var list2 = db.Queryable<Student>()
|
.Select("id").ToList();
|
||||||
// .Where(st => st.Id > 0)
|
|
||||||
// .Select("id").ToList();
|
|
||||||
|
|
||||||
var list = db.Queryable<Student, School,School>((st, sc,sc2) => new object[] {
|
var list3 = db.Queryable<Student, School,School>((st, sc,sc2) => new object[] {
|
||||||
JoinType.Left,st.SchoolId==sc.Id,
|
JoinType.Left,st.SchoolId==sc.Id,
|
||||||
JoinType.Left,sc2.Id==sc.Id
|
JoinType.Left,sc2.Id==sc.Id
|
||||||
}).Where(st => st.Id > 0)
|
}).Where(st => st.Id > 0)
|
||||||
.Select<School>((st) =>new School() { Id=st.Id}).ToList();
|
.Select<School>((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")
|
.AddJoinInfo("School", "sh", "sh.id=st.schoolid")
|
||||||
.Where("st.id>@id")
|
.Where("st.id>@id")
|
||||||
.AddParameters(new {id=1})
|
.AddParameters(new {id=1})
|
||||||
|
Reference in New Issue
Block a user