01.
Dim
leftList = {
02.
New
With
{.ID = 1, .Name =
"John"
, .Changed =
False
},
03.
New
With
{.ID = 2, .Name =
"Obama"
, .Changed =
False
},
04.
New
With
{.ID = 3, .Name =
"Kinton"
, .Changed =
False
}
05.
}
06.
Dim
rightList = {
07.
New
With
{.ID = 1, .Name =
"John"
, .Changed =
False
},
08.
New
With
{.ID = 3, .Name =
"Kinton"
, .Changed =
True
},
09.
New
With
{.ID = 4, .Name =
"Payboy"
, .Changed =
False
},
10.
New
With
{.ID = 5, .Name =
"หำ"
, .Changed =
False
}
11.
}
12.
13.
14.
Dim
resultLeftExcludingJoin = leftList.LeftExcludingJoin(rightList,
Function
(p) p.ID,
Function
(a) a.ID, _
15.
Function
(p, a)
New
With
{Key .MyPerson = p, Key .MyAddress = a}) _
16.
.
Select
(
Function
(a)
New
With
{ _
17.
Key .LeftID = (
If
(a.MyPerson IsNot
Nothing
, a.MyPerson.ID &
" Left"
,
"Null-Value"
)), _
18.
Key .RightID = (
If
(a.MyAddress IsNot
Nothing
, a.MyAddress.ID &
" Right"
,
"Null-Value"
)), _
19.
Key .LeftName = (
If
(a.MyPerson IsNot
Nothing
, a.MyPerson.Name &
" Left"
,
"Null-Value"
)), _
20.
Key .RightName = (
If
(a.MyAddress IsNot
Nothing
, a.MyAddress.Name &
" Right"
,
"Null-Value"
)), _
21.
Key .LeftChanged = (
If
(a.MyPerson IsNot
Nothing
, a.MyPerson.Changed &
" Left"
, -1)), _
22.
Key .RightChanged = (
If
(a.MyAddress IsNot
Nothing
, a.MyAddress.Changed &
" Left"
, -1))
23.
}).ToList()