mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
-
This commit is contained in:
@@ -8,5 +8,10 @@ namespace OrmTest.Models
|
||||
{
|
||||
public class ViewModelStudent:Student
|
||||
{
|
||||
|
||||
}
|
||||
public class ViewModelStudent2
|
||||
{
|
||||
public Student Student { get; set; }
|
||||
}
|
||||
}
|
||||
|
@@ -32,9 +32,12 @@ namespace OrmTest.UnitTest
|
||||
//var list = db.Queryable<Student>()
|
||||
// .Where(st => st.Id > 0)
|
||||
// .Select(it => new ViewModelStudent { Name = it.Name }).ToList();
|
||||
var list2 = db.Queryable<Student>()
|
||||
.Where(st => st.Id > 0)
|
||||
.Select("id").ToList();
|
||||
//var list2 = db.Queryable<Student>()
|
||||
// .Where(st => st.Id > 0)
|
||||
// .Select("id").ToList();
|
||||
var list3 = db.Queryable<Student>()
|
||||
.Where(st => st.Id > 0)
|
||||
.Select(it => new ViewModelStudent2 { Student = it }).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user