This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static IEnumerable<TResult> LeftJoin<TSource, TInner, TKey, TResult>(this IEnumerable<TSource> source, | |
| IEnumerable<TInner> inner, | |
| Func<TSource, TKey> primaryKey, | |
| Func<TInner, TKey> foreignKey, | |
| Func<TSource, TInner, TResult> resultCollection) | |
| { | |
| var result = from s in source | |
| join i in inner | |
| on primaryKey(s) equals foreignKey(i) into joinData | |
| from left in joinData.DefaultIfEmpty() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static class LinqExtension | |
| { | |
| public static IEnumerable<TResult> LeftJoin<TSource, TInner, TKey, TResult>(this IEnumerable<TSource> source, | |
| IEnumerable<TInner> inner, | |
| Func<TSource, TKey> primaryKey, | |
| Func<TInner, TKey> foreignKey, | |
| Func<TSource, TInner, TResult> resultCollection) | |
| { | |
| var result = from s in source | |
| join i in inner |
NewerOlder