ฉันได้รับข้อผิดพลาดต่อไปนี้: "คำขอดึงข้อมูลต้องเป็นนิพจน์การเข้าถึงสมาชิกแบบธรรมดา '[100002]' เป็น SubQueryExpression แทน ชื่อพารามิเตอร์: relatedObjectSelector"
ด้านล่างนี้คือคำถามของฉัน:
var query =
session.Query<Customer().Where(cus => cus.CustomerId == customerId)
.Fetch(c => c.CustomerType) // Parent CustomerType
.Fetch(c => c.CustomerOrders) // Child Collection of orders
.ThenFetch(co => co.Select(it => it.Item)).ToList(); // A parent of CustomerOrder
หากฉันนำ 'ThenFetch' ออก ฉันจะไม่ได้รับข้อผิดพลาดนั้น อย่างไรก็ตาม ฉันจำเป็นต้องดึงข้อมูลวัตถุ Item
มีความคิดอะไรบ้าง?
ขอบคุณ