craig

My feedback

  1. 865 votes
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    craig commented  · 

    The suggestions below indicate that this can be with EF4. These comments are not correct, as the relationship depends specifically on change tracking. This can be illustrated as follows.

    var p = ParentTable.AsNoTracking().Select(o => new { Parent = o, Children = o.Children.Where(_ => _.Name.Length == "child")}).AsEnumerable().Select (_p => _p.Parent);

    does not work.

    var p = ParentTable.Select(o => new { Parent = o, Children = o.Children.Where(_ => _.Name.Length == "child")}).AsEnumerable().Select (_p => _p.Parent);

    Appears to work because a subset of the children happen to be change tracked.

    craig supported this idea  · 

Feedback and Knowledge Base