Class LinqExtensions
Various LinQ extensions.
public static class LinqExtensions
- Inheritance
-
LinqExtensions
- Inherited Members
Methods
AppendIf<T>(IEnumerable<T>, bool, IEnumerable<T>)
Add a collection to the end of another collection if a condition is met.
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, IEnumerable<T> append)
Parameters
source
IEnumerable<T>The collection.
condition
boolThe condition.
append
IEnumerable<T>The collection to append.
Returns
- IEnumerable<T>
Type Parameters
T
AppendIf<T>(IEnumerable<T>, bool, Func<T>)
Add an item to the end of a collection if a condition is met.
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, Func<T> append)
Parameters
source
IEnumerable<T>The collection.
condition
boolThe condition.
append
Func<T>Func to create the item to append.
Returns
- IEnumerable<T>
Type Parameters
T
AppendIf<T>(IEnumerable<T>, bool, T)
Add an item to the end of a collection if a condition is met.
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, bool condition, T append)
Parameters
source
IEnumerable<T>The collection.
condition
boolThe condition.
append
TThe item to append.
Returns
- IEnumerable<T>
Type Parameters
T
AppendIf<T>(IEnumerable<T>, Func<bool>, IEnumerable<T>)
Add a collection to the end of another collection if a condition is met.
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, IEnumerable<T> append)
Parameters
source
IEnumerable<T>The collection.
condition
Func<bool>The condition.
append
IEnumerable<T>The collection to append.
Returns
- IEnumerable<T>
Type Parameters
T
AppendIf<T>(IEnumerable<T>, Func<bool>, Func<T>)
Add an item to the end of a collection if a condition is met.
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, Func<T> append)
Parameters
source
IEnumerable<T>The collection.
condition
Func<bool>The condition.
append
Func<T>Func to create the item to append.
Returns
- IEnumerable<T>
Type Parameters
T
AppendIf<T>(IEnumerable<T>, Func<bool>, T)
Add an item to the end of a collection if a condition is met.
public static IEnumerable<T> AppendIf<T>(this IEnumerable<T> source, Func<bool> condition, T append)
Parameters
source
IEnumerable<T>The collection.
condition
Func<bool>The condition.
append
TThe item to append.
Returns
- IEnumerable<T>
Type Parameters
T
AppendWith<T>(IEnumerable<T>, IEnumerable<T>)
Add a collection to the end of another collection.
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, IEnumerable<T> append)
Parameters
source
IEnumerable<T>The collection.
append
IEnumerable<T>The collection to append.
Returns
- IEnumerable<T>
Type Parameters
T
AppendWith<T>(IEnumerable<T>, Func<T>)
Add an item to the end of a collection.
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, Func<T> append)
Parameters
source
IEnumerable<T>The collection.
append
Func<T>Func to create the item to append.
Returns
- IEnumerable<T>
Type Parameters
T
AppendWith<T>(IEnumerable<T>, T)
Add an item to the end of a collection.
public static IEnumerable<T> AppendWith<T>(this IEnumerable<T> source, T append)
Parameters
source
IEnumerable<T>The collection.
append
TThe item to append.
Returns
- IEnumerable<T>
Type Parameters
T
Convert<T>(IEnumerable, Func<object, T>)
Convert each item in the collection.
public static IEnumerable<T> Convert<T>(this IEnumerable source, Func<object, T> converter)
Parameters
source
IEnumerableThe collection.
converter
Func<object, T>Func to convert the items.
Returns
- IEnumerable<T>
Type Parameters
T
Examine<T>(IEnumerable<T>, Action<T>)
Calls an action on each item before yielding them.
public static IEnumerable<T> Examine<T>(this IEnumerable<T> source, Action<T> action)
Parameters
source
IEnumerable<T>The collection.
action
Action<T>The action to call for each item.
Returns
- IEnumerable<T>
Type Parameters
T
FilterCast<T>(IEnumerable)
Returns and casts only the items of type T
.
public static IEnumerable<T> FilterCast<T>(this IEnumerable source)
Parameters
source
IEnumerableThe collection.
Returns
- IEnumerable<T>
Type Parameters
T
ForEach<T>(IEnumerable<T>, Action<T, int>)
Perform an action on each item.
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T, int> action)
Parameters
source
IEnumerable<T>The source.
action
Action<T, int>The action to perform.
Returns
- IEnumerable<T>
Type Parameters
T
ForEach<T>(IEnumerable<T>, Action<T>)
Perform an action on each item.
public static IEnumerable<T> ForEach<T>(this IEnumerable<T> source, Action<T> action)
Parameters
source
IEnumerable<T>The source.
action
Action<T>The action to perform.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, bool, IEnumerable<T>)
Add a collection to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, IEnumerable<T> prepend)
Parameters
source
IEnumerable<T>The collection.
condition
boolThe condition.
prepend
IEnumerable<T>The collection to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, bool, Func<T>)
Add an item to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, Func<T> prepend)
Parameters
source
IEnumerable<T>The collection.
condition
boolThe condition.
prepend
Func<T>Func to create the item to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, bool, T)
Add an item to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, bool condition, T prepend)
Parameters
source
IEnumerable<T>The collection.
condition
boolThe condition.
prepend
TThe item to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, Func<bool>, IEnumerable<T>)
Add a collection to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, IEnumerable<T> prepend)
Parameters
source
IEnumerable<T>The collection.
condition
Func<bool>The condition.
prepend
IEnumerable<T>The collection to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, Func<bool>, Func<T>)
Add an item to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, Func<T> prepend)
Parameters
source
IEnumerable<T>The collection.
condition
Func<bool>The condition.
prepend
Func<T>Func to create the item to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, Func<bool>, T)
Add an item to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<bool> condition, T prepend)
Parameters
source
IEnumerable<T>The collection.
condition
Func<bool>The condition.
prepend
TThe item to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, Func<IEnumerable<T>, bool>, IEnumerable<T>)
Add a collection to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, IEnumerable<T> prepend)
Parameters
source
IEnumerable<T>The collection.
condition
Func<IEnumerable<T>, bool>The condition.
prepend
IEnumerable<T>The collection to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, Func<IEnumerable<T>, bool>, Func<T>)
Add an item to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, Func<T> prepend)
Parameters
source
IEnumerable<T>The collection.
condition
Func<IEnumerable<T>, bool>The condition.
prepend
Func<T>Func to create the item to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependIf<T>(IEnumerable<T>, Func<IEnumerable<T>, bool>, T)
Add an item to the beginning of another collection, if a condition is met.
public static IEnumerable<T> PrependIf<T>(this IEnumerable<T> source, Func<IEnumerable<T>, bool> condition, T prepend)
Parameters
source
IEnumerable<T>The collection.
condition
Func<IEnumerable<T>, bool>The condition.
prepend
TThe item to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependWith<T>(IEnumerable<T>, IEnumerable<T>)
Add a collection to the beginning of another collection.
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, IEnumerable<T> prepend)
Parameters
source
IEnumerable<T>The collection.
prepend
IEnumerable<T>The collection to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependWith<T>(IEnumerable<T>, Func<T>)
Add an item to the beginning of a collection.
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, Func<T> prepend)
Parameters
source
IEnumerable<T>The collection.
prepend
Func<T>Func to create the item to prepend.
Returns
- IEnumerable<T>
Type Parameters
T
PrependWith<T>(IEnumerable<T>, T)
Add an item to the beginning of a collection.
public static IEnumerable<T> PrependWith<T>(this IEnumerable<T> source, T prepend)
Parameters
source
IEnumerable<T>The collection.
prepend
TThe item to prepend.
Returns
- IEnumerable<T>
Type Parameters
T