private TResult GetRightResult(TRight right)
 => _resultSelector.Invoke(JoinOption.None <TLeft>(), JoinOption.Some(right));
 private TResult GetLeftResult(TLeft left)
 => _resultSelector.Invoke(JoinOption.Some(left), JoinOption.None <TRight>());
Ejemplo n.º 3
0
 public static IEnumerable <TResult> LeftExcludingJoin <TLeft, TRight, TKey, TResult>(this IEnumerable <TLeft> source, IEnumerable <TRight> join, Func <TLeft, TKey> leftKeySelector, Func <TRight, TKey> rightKeySelector, Func <TLeft, JoinOption <TRight>, TResult> resultSelector)
 => source.GroupJoin(join, leftKeySelector, rightKeySelector, (l, rs) => rs.DefaultIfEmpty().Where(o => o == null).Select(_ => resultSelector.Invoke(l, JoinOption.None <TRight>()))).SelectMany(o => o).ToArray();
Ejemplo n.º 4
0
 public static IEnumerable <TResult> RightExcludingJoin <TLeft, TRight, TKey, TResult>(this IEnumerable <TLeft> source, IEnumerable <TRight> join, Func <TLeft, TKey> leftKeySelector, Func <TRight, TKey> rightKeySelector, Func <JoinOption <TLeft>, TRight, TResult> resultSelector)
 => join.GroupBy(rightKeySelector).SelectMany(g => g).GroupJoin(source, rightKeySelector, leftKeySelector, (r, ls) => ls.DefaultIfEmpty().Where(o => o == null).Select(_ => resultSelector.Invoke(JoinOption.None <TLeft>(), r))).SelectMany(o => o).ToArray();
Ejemplo n.º 5
0
 public static IEnumerable <TResult> LeftJoin <TLeft, TRight, TKey, TResult>(this IEnumerable <TLeft> source, IEnumerable <TRight> join, Func <TLeft, TKey> leftKeySelector, Func <TRight, TKey> rightKeySelector, Func <TLeft, JoinOption <TRight>, TResult> resultSelector)
 => source.GroupJoin(join, leftKeySelector, rightKeySelector, (l, rs) => rs.Select(r => JoinOption.Some(r)).DefaultIfEmpty(JoinOption.None <TRight>()).Select(r => resultSelector.Invoke(l, r))).SelectMany(o => o).ToArray();