Appendix A. Enumeration Extension Methods
Contents
[
Hide
]
LINQ Reporting Engine enables you to perform common manipulations on a sequential data through the engine’s built-in extension methods for IEnumerable
. These extension methods mimic some extension methods of IEnumerable<T> providing the same signatures and behavior features. Thus you can group, sort and perform other sequential data manipulations in template expressions in a familiar way.
The following table describes these built-in extension methods. The following notation conventions are used within the table:
- Selector stands for a lambda function returning a value and taking an enumeration item as its single argument. See “Using Lambda Functions” for more information.
ComparableSelector
stands forSelector
returning IComparable.EnumerationSelector
stands forSelector
returningIEnumerable
.Predicate
stands forSelector
returning a Boolean value.
Examples in the following table are given using persons and otherPersons
, enumerations of instances of the Person
class that is defined as follows.
public class Person
{
public String Name { get { ... } }
public int Age { get { ... } }
public IEnumerable<Person> Children { get { ... } }
...
}
Extension Method | Examples and Notes |
---|---|
All(Predicate) |
|
Any() |
|
Any(Predicate) |
|
Average(Selector) |
|
Concat(IEnumerable) |
|
Contains(Object) |
|
Count() |
|
Count(Predicate) |
|
Distinct() |
|
First() |
|
First(Predicate) |
|
FirstOrDefault() |
|
FirstOrDefault(Predicate) |
|
GroupBy(Selector) |
|
Last() |
|
Last(Predicate) |
|
LastOrDefault() |
|
LastOrDefault(Predicate) |
|
Max(ComparableSelector) |
|
Min(ComparableSelector) |
|
OrderBy(ComparableSelector) |
|
OrderByDescending(ComparableSelector) |
|
Select(Selector) |
|
SelectMany(EnumerationSelector) |
|
Single() |
|
Single(Predicate) |
|
SingleOrDefault() |
|
SingleOrDefault(Predicate) |
|
Skip(int) |
|
SkipWhile(Predicate) |
|
Sum(Selector) |
|
Take(int) |
|
TakeWhile(Predicate) |
|
Union(IEnumerable) |
|
Where(Predicate) |
|