Update SetContext

This commit is contained in:
sunkaixuan
2022-05-03 13:46:54 +08:00
parent 0d59a72b12
commit b6321e0a3e
3 changed files with 111 additions and 3 deletions

View File

@@ -16,6 +16,17 @@ namespace OrmTest
.MappingField(z=>z.studenId,()=>it.StudentId)
.MappingField(z => z.BookId, () => it.StudentId).ToList())
.ToList();
var list2 = db.Queryable<StudentA>().ToList();
db.ThenMapper(list2, it =>
{
it.Books = db.Queryable<BookA>().Where(z=>z.BookId==1).SetContext(
z => z.studenId, () => it.StudentId,
z => z.BookId, () => it.StudentId,
it);
});
}
public class StudentA