IEnumerableExtensions¶
General-purpose LINQ gap-fillers: eager iteration, string-joining, membership testing, trailing-item selection, keyed distinct, and full/left outer joins. (BR-039, BR-085) through BR-088
Purpose¶
- General-purpose LINQ gap-fillers: eager iteration, string-joining, membership testing, trailing-item selection, keyed distinct, and full/left outer joins. (BR-039, BR-085) through BR-088
Context¶
- Namespace:
SAIF.Common.Extensions - Assembly/package:
SAIF.Framework.Common
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| ForEach |
public static void ForEach<T>(this IEnumerable<T> source, Action<T> action) |
Eagerly invokes action for every element of source. (BR-039) |
| ToStringAll |
public static string ToStringAll<T>(this IEnumerable<T> source, string separator) |
Joins each element's ToString() with separator. (BR-039, BR-085) |
| ToStringAll |
public static string ToStringAll<T>(this IEnumerable<T> source, string separator, Func<T,string> function) |
Joins each element's custom string projection with separator. (BR-039, BR-085) |
| IsIn |
public static bool IsIn<T>(this T value, params T[] set) |
Tests whether value is a member of the supplied set. |
| TakeFromEnd |
public static IEnumerable<T> TakeFromEnd<T>(this IEnumerable<T> source, int count) |
Returns the trailing count elements, preserving their original relative order. (BR-086) |
| Distinct |
public static IEnumerable<TSource> Distinct<TSource,TKey>(this IEnumerable<TSource> source, Func<TSource,TKey> keySelector) |
Returns the first element for each distinct key, a "distinct-by" LINQ does not provide natively. (BR-087) |
| None |
public static bool None<TSource>(this IEnumerable<TSource> source, Func<TSource,bool> predicate) |
The negation of Any(predicate). |
| ToLowerAll(this IEnumerable |
public static IEnumerable<string> ToLowerAll(this IEnumerable<string> source) |
Lower-cases every string in the sequence. |
| FullOuterGroupJoin |
public static IEnumerable<TResult> FullOuterGroupJoin<TA,TB,TKey,TResult>(this IEnumerable<TA> a, IEnumerable<TB> b, Func<TA,TKey> selectKeyA, Func<TB,TKey> selectKeyB, Func<TA,IEnumerable<TB>,TKey,TResult> projection, TA defaultA = default(TA), TB defaultB = default(TB), IEqualityComparer<TKey> comparer = null) |
Full outer group-join over two sequences, substituting the supplied defaults where one side has no match. (BR-088) |
| FullOuterJoin |
public static IEnumerable<TResult> FullOuterJoin<TA,TB,TKey,TResult>(this IEnumerable<TA> a, IEnumerable<TB> b, Func<TA,TKey> selectKeyA, Func<TB,TKey> selectKeyB, Func<TA,TB,TKey,TResult> projection, TA defaultA = default(TA), TB defaultB = default(TB), IEqualityComparer<TKey> comparer = null) |
Full outer join over two sequences, substituting the supplied defaults where one side has no match. (BR-088) |
| LeftOuterJoin |
public static IEnumerable<TResult> LeftOuterJoin<TA,TB,TKey,TResult>(this IEnumerable<TA> a, IEnumerable<TB> b, Func<TA,TKey> selectKeyA, Func<TB,TKey> selectKeyB, Func<TA,TB,TKey,TResult> projection, TB defaultB = default(TB), IEqualityComparer<TKey> comparer = null) |
Left outer join keyed only on the left sequence's keys, substituting defaultB where the right side has no match. (BR-088) |
Sources¶
Common/SAIF.Common/Extensions/IEnumerableExtensions.cs