开发者

Linq with array

Dim Cozinhas as string = "1, 2, 3"
Dim FiltroCozinha() As String = Cozinhas.Split(",")

Dim Empresas = (From E In lstEmpresas _
                Group Join CE In lstCozinhasEmpresas On CE.EmpresaID Equals E.EmpresaID Into CEJ = Group From CE In CEJ.DefaultIfEmpty() _
                Group Join FC In lstFiltroCozinha On FC Equals CE.CozinhaID Into FCJ = Group From FC In FCJ.DefaultIfEmpty() _
                Select New With {E.Nome} _
               ).Distinct.ToL开发者_StackOverflow中文版ist

Throws exception "Object reference not set to an instance of an object."... but if I remove

                Group Join FC In lstFiltroCozinha On FC Equals CE.CozinhaID Into FCJ = Group From FC In FCJ.DefaultIfEmpty() _

It works. How do I do left join with the array "FiltroCozinha"?


I think you are declaring and utilizing the same variable in the same line

Dim Empresas = (From E In Empresas _

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜