Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 需要在linq中写入2个外部联接_C#_Linq - Fatal编程技术网

C# 需要在linq中写入2个外部联接

C# 需要在linq中写入2个外部联接,c#,linq,C#,Linq,我需要使用linq编写以下查询。非常感谢您的帮助 select r1.rID, name, uName, 001 aID, nvl(uValue, 0) uValue from r1, r2, l where r1.rID = r2.rID and r1.rID = l.rID(+) and 001 =

我需要使用linq编写以下查询。非常感谢您的帮助

select
        r1.rID,
        name,
        uName,
        001 aID,
        nvl(uValue, 0) uValue
    from
        r1,
        r2,
        l
    where
        r1.rID = r2.rID 
        and r1.rID = l.rID(+) 
        and 001 = l.aID(+)
    order by
        r1.rID

应该是这样的:

var result = (from  r1 in db.r1
              join  r2 in db.r2 on r1.rID equals r2.rID
              join  l  in db.l  on r1.rID equals l.rID
              where l.aID == "001"
              orderby r1.rID 
              select new {
                  rID    = r1.rID,
                  Name   = r1.name,
                  UName  = r1.uName,
                  aID    = "001",
                  UValue = nvl(r.uValue)
              }).ToList(); 

所以就这样做吧,或者雇佣一个程序员,“(+)”是“外部连接”的一种神谕方式。它们在C#/LINQ中没有意义