4 using System
.Collections
.Generic
;
21 public static int Main ()
23 DataA
[] d1
= new DataA
[] { new DataA () { Key = 1, Text = "Foo" }}
;
24 DataB
[] d2
= new DataB
[] { new DataB () { Key = 2, Value = "Second" }}
;
27 join b
in d2 on a
.Key equals b
.Key
into ab
28 from x
in ab
.DefaultIfEmpty ()
29 select new { a = x == default (DataB) ? "<empty>" : x.Value, b = a.Text }
;
31 var res
= e
.ToList ();
35 if (res
[0].a
!= "<empty>")
38 if (res
[0].b
!= "Foo")
43 join DataB b
in d2 on a
.Key equals b
.Key
into ab
44 from x
in ab
.DefaultIfEmpty ()
45 select new { a = x == default (DataB) ? "<empty>" : x.Value, b = a.Text }
;
48 Console
.WriteLine (o
);
54 if (res
[0].a
!= "<empty>")
57 if (res
[0].b
!= "Foo")
61 join a
in d2 on a
.Key equals a
.Key
into ab
64 Console
.WriteLine ("OK");