Hi all
I'm evaluating LLBLGen and stumbled over what looks like a bug with this simple query that contains a prefetch path. I simplified it a little in order to give you an easy repro.
Bascially, we have a 1:n relationship between a JobFunctionGroup and its contained job functions. What I did is for a set of functions, i would like to prefetch the group and also populate the group's JobFunctions collection immediately.
This hits the DB with 3 queries that eventually resolve all the job functions. However, the JobFunctions collection of the group contains the first element twice:
LinqMetaData md = new LinqMetaData(adapter);
var functions = from f in md.JobFunction where f.JobFunctionGroup.Description.Contains("Bin") select f;
functions = functions.WithPath(p => p.Prefetch<JobFunctionGroupEntity>(jf => jf.JobFunctionGroup)
.SubPath(p2 => p2.Prefetch(g => g.JobFunctions)));
var group = functions.First().JobFunctionGroup;
var result = group.JobFunctions.OrderBy(f => f.JobFunctionNbr);