I have 2 tables:
T1
{
Columns: **A**, B, C
}
T2
{
Columns: D, E, F, **A**
}
T1
has one to many connection to T2
using a foreign key (column A ).
I'm trying to retrieve a list of F
in case that A=1,B=2,E=3
.
What is the right and efficient way to retrieve this data?
T1 (where A=1,B=2)
including T2
and then looping over the result (and eliminate the irrelevant T2
)? var lst = (from t1 in context.T1
join t2 in context.T2 on t1.A equals t2.A
where t1.A == 1 && t1.B == 2 && t2.E == 3
select t2.F).ToList();
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.