4
我在创建使用LINQ &下面的SQL语句的问题嗨C#如何使联接使用LINQ to SQL和C#
select c.IDAddenda, c.Descripcion
from CatAddendas c
right join EmpresaAddenda e on e.IDAddenda = c.IDAddenda
where e.rfc = 'SUL010720JN8'
order by c.IDAddenda asc
我得到这个
public IEnumerable<CatAddenda> TraeAddendas(string rfc)
{
DataClasses1DataContext dc = new DataClasses1DataContext(...);
return (from adds in dc.EmpresaAddendas
cats.IDAddenda into joined
where adds.RFC == rfc
select adds.CatAddenda);
}
这是一个正确的没有做正确的加入,所以有什么想法?
http://stackoverflow.com/questions/2730810/right-outer-join-in-linq – Phil 2012-03-28 19:52:26