none
The nested query is not supported. Operation1='Case' Operation2='Collect' RRS feed

  • Question

  • I am getting this error while trying to do a conditional based selection inside linq select.

    Here is my code

    from x in DatabaseContext.Set<XXX>()
        select new
        {
            x.A,
            x.B,
            innerGridData = x.C == true ?
                                       (from y in DatabaseContext.Set<YYY>() where y.A == x.A
                                        select new InnerGridData()
                                       { 
                                            Q = y.A,
                                            W = y.B, 
                                            E = y.C,
                                            R = y.D,
                                            T = y.E,
                                            Y = y.F
                                       }) :
                                       (from z in DatabaseContext.Set<ZZZ>() where z.A == x.A
                                        select new InnerGridData()
                                        {  
                                            Q = z.A,
                                            W = z.B, 
                                            E = z.C,
                                            R = z.D,
                                            T = z.E,
                                            Y = z.F
                                        }) 
        }


    Any help is deeply appreciated. Thanks in advance
    • Edited by Nandha's Thursday, December 13, 2012 6:41 AM
    Thursday, December 13, 2012 6:40 AM

Answers