3
I have the consultation below
var f = (from l in fpcList
join fpp in FPP on new { l.fpId, l.etId } equals new { fpp.fpId, fpp.etId }
join fpcp in FPCP on fpp.fppId equals fpcp.fppId
select new { fpp.fppId, fpp.fpId, fpp.etId, fpcp.ecId }).ToList();
The fpcList list has a regular 24 items
The FPP table has more than 200,000 items
The FPCP Table has over 600,000 items
The consultation is slow, I am a beginner programmer and if anyone knows another way to do the same, I appreciate.
SOLUTION (10-07-2019)
Post because it can help other programmers! I made the query to the Database first and then applied the filters of the list. Performance has improved significantly.
var f= (from fpp in FPP
join fpcp in FPCP on fpp.fppId equals fpcp.fppId
select new { fpp.fppId , fpp.fpId, fpp.etId, fpcp.ecId}).AsEnumerable()
.Where(y => fpcList.Any(x => x.fpId == y.fpId && x.etId == y.etId ))
.Select(x => new { x.fppId, x.fpId, x.etId, x.ecId}).ToList();
Thank you all very much
You need all the items at once?
– CypherPotato