diff --git a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom012.cs b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom012.cs index 29a9a1c51..5f5c61573 100644 --- a/Src/Asp.Net/SqlServerTest/UnitTest/UCustom012.cs +++ b/Src/Asp.Net/SqlServerTest/UnitTest/UCustom012.cs @@ -54,6 +54,14 @@ namespace OrmTest db.Insertable(new BookA() { BookId = 5, Names = "js", studenId = 4 }).ExecuteCommand(); db.Insertable(new BookA() { BookId = 6, Names = "北大jack", studenId = 1 }).ExecuteCommand(); + var list1 = db.Queryable() + .Includes(it=>it.Books) + .Select(it => new StudentADTO() { Books = it.Books }, true).ToList(); + + if (list1.First().Books.Count() == 0 || list1.First().StudentId == 0) + { + throw new Exception("unit error"); + } var list2 = db.Queryable() .Includes(x => x.SchoolA, x => x.RoomList)//2个参数就是 then Include .Includes(x => x.SchoolA, x => x.TeacherList)//2个参数就是 then Include @@ -506,6 +514,13 @@ namespace OrmTest } + public class StudentADTO + { + public int StudentId { get; set; } + + public List Books { get; set; } + } + internal class DTO { public string name3 { get; set; }