MoreLinq provides the FullJoin extension. However, I want the bothSelector function (it's a parameter of the FullJoin function) to return the TResult only if its not null.
Example:
Given two lists full joined by the number:
List 1: 1,2,3 List 2: 1,2,3,4,5
Result List 3 : null, null, null, 4 , 5
Desired: 4, 5
public void X()
{
var list1 = new List<int> { 1, 2, 3, 4, 5 };
var list2 = new List<int> { 4, 5 };
list1.FullJoin(
list2,
item => item,
item1 => item1,
item2 => item2,
(item1, item2) => item1);
}
Can this be possible?
Thanks.
Using original FullJoin code a little bit modified: