I have a child property of a child property in my entity. I have a Get method as such:
List<T> Find(Expression<Func<T, bool>> where,
params Expression<Func<T, object>>[] toInclude);
The way I normally load just the first child property is to do this:
myManager.Find(x => x.Id == id, x.ChildB);
However, I would like to be able to pull back the ChildC property which is a child of my ChildB property.
Is there anyway to perform this with the method signature I provided? I know normally I could do a .Include("ChildB.ChildC").
Edit: Added code per request
using(MyContext context = new MyContext())
{
ObjectQuery<T> objectQuery = (ObjectQuery<T>)context.CreateObjectSet<T>();
foreach(var include in toInclude)
{
objectQuery = objectQuery.Include(include);
}
return objectQuery.Where<T>(where);
}