Skip to content

Latest commit

 

History

History
40 lines (33 loc) · 4.3 KB

File metadata and controls

40 lines (33 loc) · 4.3 KB

EnumerableExtensions class

Extension methods for IEnumerable

public static class EnumerableExtensions

Public Members

name description
static AddAll<T>(…) Add all specified items to a collection using a simple loop
static ApplyToAll<T>(…) Applies an Action to all items in an enumeration, when enumerated.
static AsObjectCollection(…) Turns a generic IEnumerable into an object[] enumeration (each property being mapped into the array)
static AsObjectCollection<T>(…) Turns a generic IEnumerable into an object[] enumeration (each property being mapped into the array)
static AsParallel<T>(…) Shortcut to create a ParallelQuery, optionnally using only one thread (disabling in fact parallelism but keeping the same return type). Used in fluent queries.
static AverageChecked<T>(…) Computes an average for all values in an enumerable, ensuring they can be converted to double (using a DoubleConverter).
static GetInnerType(…) Returns the actual "inner" type of an element in a IEnumerable containing genericly typed items
static GetInnerType<T>(…) Returns the actual "inner" type of an element in a collection when T is also a generic type
static GreatestCommonDiv(…) Computes the greatest common divisor for an integer enumeration
static Merge<T>(…) Merges two enumerables using the specified comparer. Does use a Set (as defined in .Net reference source) internally to optimize merging. (2 methods)
static OrderByAll(…) Sorts an untyped IQueryable by guessing the inner type, using OrderByAllTyped
static OrderByAll<T>(…) Orders an IEnumerable which items are also IEnumerable by all it's inner enumeration values, optionnally skipping some (2 methods)
static OrderByAllTyped<T>(…)
static OrderByMany<T>(…) Orders an enumerable of T[] by multiple items (using indexes) (3 methods)
static Pivot<T,TKeys,TPivoted,TAggregate>(…) Creates a pivot table (a table where columns are created from specified values in a collection) from a IEnumerable of T, using the specified selector and aggregators.
static ReplaceAll<T>(…) Replaces all items it an ICollection source by the specified items.
static ToDataTable(…) Creates a DataTable from an IEnumerable of object[] with the specified columns.
static ToDataTable<T>(…) Creates a DataTable from an IEnumerable, optionnally overriding the column headers.
static ToObject(…) Turns a generic list of values to an object, mapping each list items to properties of the specified target type.
static ToObject<T>(…) Turns a generic list of values to an object, mapping each list items to properties of the specified target type. Uses ToObject (2 methods)
static ToPivotTable<T,TPivoted,TKeys,TAggregate>(…) Creates a pivot table (a table where columns are created from specified values in a collection) from a IEnumerable of T, using the specified selector and aggregators.
static WithProgress<T>(…) Adds a progress callback to any enumeration, which will increment an internal counter when enumerating and call the specified callback.

See Also