这是我的 Linq 查询。
var tmp = (from oScreenDef in listScreenDefinition
join oSynSession in listSynSession on
new { c1 = oScreenDef["venueCd"], c2 = oScreenDef["screenBytNum"] }
equals new { c1 = oSynSession["cinemaId"], c2 = oSynSession["screenDetails"].AsBsonDocument["num"] }
join oSessionAreaCount in listSessionAreaCount on
new { c1 = oScreenDef["venueCd"] }
equals new { c1 = oSessionAreaCount["cinemaId"] }
join oPrices in listSynPrices on
new { c1 = oScreenDef["venueCd"], c2 = oSynSession["cinemaId"] }
equals new { c1 = oPrices["cinemaId"], c2 = oPrices["cinemaId"] }
select new { doc = oSynSession[0], oScreenDef }).ToList();
在那个oPrices对象有cinemaIDwhich 应该等于oScreenDef["venueId"]and oSynSession["cinemaId"]。
为此,我包括两次oPrices["cinemaId"]asC1和C2..
我该如何避免这种情况以及如何改进此查询。
请建议更好的方法..
所有listScreenDefinition, listSessionAreaCount,listSynPrices都是List<BsonDocument>从mongodb查询中获取的项目..