Left Outer Join via Linq To Entities via Entity Framework with Where clause?

Bar { get; set; } } var innerQuery = from foo in context. Foos from bar in context. Bars where foo.

Name == 'fooname' || bar. Description == 'bardesc' where foo. FooId == bar.

FooId select new FooBar { Foo = foo, Bar = bar }; var outerQuery = from foo in context. Foos where foo.Name == 'fooname' where!context.Bars. Any(b => b.

FooId == foo. FooId) select new FooBar { Foo = foo, Bar = null }; var leftouterjoinQuery = innerQuery. Union(outerQuery).Distinct().

. NET 3.5 private class FooBar { public Foo Foo { get; set; } public Bar? Bar { get; set; } } var innerQuery = from foo in context.

Foos from bar in context. Bars where foo. Name == 'fooname' || bar.

Description == 'bardesc' where foo. FooId == bar. FooId select new FooBar { Foo = foo, Bar = bar }; var outerQuery = from foo in context.

Foos where foo. Name == 'fooname' where!context.Bars. Any(b => b.

FooId == foo. FooId) select new FooBar { Foo = foo, Bar = null }; var leftouterjoinQuery = innerQuery. Union(outerQuery).Distinct().

. NET 4.0 var query = (from foo in context. Foo join be in context.

Bar on foo. FooId equals b. FooId into Bar from bar in Bar.DefaultIfEmpty() where foo.Name = 'fooname' || bar.

Description = 'bardesc' select new { foo, bar }).Distinct().

I appreciate you answer, however, .DefaultIfEmpty() is not supported for Linq to Entities and will generate a runtime error when the Entity Framework attempts to create the corresponding SQL. – EulerOperator Mar 22 at 17:59.

Var outerQuery = from foo in context. Any(b => b. FooId == foo.

Var leftouterjoinQuery = innerQuery. Var query = (from foo in context. Join be in context.

FooId equals b. Where foo.Name = 'fooname' || bar.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions