After much pulling out of hair I discovered that the foreach
loops were the culprits. What needs to happen is to call EF but return it into an IList<T>
of that target type then loop on the IList<T>
.
Example:
IList<Client> clientList = from a in _dbFeed.Client.Include("Auto") select a;
foreach (RivWorks.Model.NegotiationAutos.Client client in clientList)
{
var companyFeedDetailList = from a in _dbRiv.AutoNegotiationDetails where a.ClientID == client.ClientID select a;
// ...
}