none
LinQ IN Statement for child query RRS feed

  • Question

  • Hey
    Can someone please tell me, how I correctly write this LinQ
    I have the following code, but it doesn't work as provided:
    Dim myKunden = From Query In LinqProvider.GetProvider.Kundenstamms Join Auf In _
                           LinqProvider.GetProvider.auftrags.Where(Function(x) GetID.Contains(x.Id)) On Query.Kundenid Equals Auf.Kundenid
    What I want to do here is: Get the Master table (Kundenstamms) with all child tables (auftrags) where the child tables are only in a List of Integers (GetID)
    The code, above brings me the master table with all childs but for example 4 times.

    For example: GetID contains 4 numbers, then I get 4 times the Master table but with al childs - What I want is to get the master 1 time and the related childs.

    Hope you understand... (Not so easy to explain...)

    THX
    Thursday, October 1, 2009 12:01 PM

Answers