If I had an Object A that contained a many-to-one reference to Object B, where Object B contained a one-to-many collection of Object C… consider the following query:
IQueryable<A> query = getIQueryableSomehow();
List<B> resultList = query.Where(A => A.whatever == something).Select(A => A.B).Fetch(B => B.C).ToList();
I want to do something similar to this, but I keep getting a null reference exception with this code. Is there a sneaky trick to achieve this kind of query AND fetch a bunch of Object B collections, or is it impossible?
Thanks!
you can specify Fetch before to load all A,B,C and then select the Bs