简体   繁体   中英

EF6 Including references of Collections in Entity

I'm setting up a context to be read as follows:

在此处输入图像描述

Now, the last include is a collection and each entity in that collection has a relation (1-to-1) to an entity called SERVICE_INFO

How do I include that entity on each BILL_INFO_DETAIL ?

Maybe you can just use,if there is navigation properties in table(BILL_INFO_DETAI):

   Include( i=> i.BILL_INFO_DETAIL.SELECT( b => b.SERVICE_INFO ));

reference: https://docs.microsoft.com/zh-tw/ef/ef6/querying/related-data

If I understood you correctly. Maybe what you want is the ThenInclude()

.Include( i=> i.BILL_INFO_DETAIL).ThenInclude(b => b.SERVICE_INFO)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM