Entity Framework Using a Where Clause on a Nested Entity

c# entity-framework entity-framework-6

Question

I'm attempting to use the following to filter child items on the retrieval.

var loanExtractExample = be.LoanCategoryMonitors
                .Where(lcm => lcm.LoanNumber == 5000435)
                .Include(l => l.Loan)
                .Include(le => le.LoanExtracts)
                .Select(le => le.LoanExtracts.Borrowers.Where(b => b.BorrowerNum == 1))
                .ToList();

however there are 2 borrowers when I look at the entity collection. One borrower number one and one borrower number three.

How do I narrow down the borrowers to the right one? What am I missing?

1
4
6/7/2018 3:10:28 AM

Popular Answer

ZZZ_tmp
0
6/7/2018 8:15:45 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow