开发者

Problem with Linq Joins with multible keys?

I've some errors with linq joins

my query is like that :

 from inv in SellServiceInvoice.All()
    join Ent in Entity.All() on new { CID = inv.EntityID, CType = inv.EntityTypeID }
    equals new { CID =(long) Ent.EntityID, CType =(long) Ent.EntityTypeID}  
    select new {...}

prob 1开发者_JAVA百科 : why must I add casting '(long)' although the types is already long!

prob 2 : it gives me the following exception:

The construtor 'Void .ctor(Int64, Int64)' is not supported


Have you tried:

from inv in SellServiceInvoice.All()
from Ent in Entity.All() 
where inv.EntityID = CID =(long) Ent.EntityID && 
      inv.EntityTypeID == (long)Ent.EntityTypeID
select new {...}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜