I am using EF4.3. At the back end I have a database that includes the following tables
In my site logic, I retrieve the entity Tier, but also eager load MatchNode, MatchBuyer and Buyer.
Here's my logic for fetching all Tier entities:
public static IEnumerable<Tier> Fetch()
{
using (var uow = new UnitOfWork(ConnectionString.Lenders))
{
var r = new Repository<Tier>(uow.Context);
return r.Find()
.Include("MatchNodes.MatchBuyer.Buyer")
.ToList();
}
}
As you can see, a Tier has many MatchNode, and each MatchNode, a single MatchBuyer and MatchBuyer a single Buyer.
However what I want to do is this. Only include MatchNode's where enabled = true and Buyer: Status = 'Active'.
Is this possible and can it be incorporated into the logic below as a .Where()?