I have to following SQL Statement that I want to conver to LINQ
Select
F.FooName
B.BarName
From Foo F
Inner Join Bar B on B.BarName = F.FooName OR B.BarName + 'hello' = F.FooName
I have seen Inner joins in Link on multiple conditions with AND Clauses but not using OR The following is as far as I have gotten
var myresult = from f in Foo
join b in Bar
on new {Name = B.BarName开发者_JAVA技巧, NamePlus = B.BarName + "hello"} equals
new {Name = F.FooName, NamePlus = F.FooName}
select new { f, b }
Clearly this is not right. Can anyone Help?
var myresult = from f in foo
from b in bar
where b.BarName == f.FooName ||
b.BarName + 'hello' == F.FooName
select new {f, b};
精彩评论