Documents generation for Jira enables you to perform common manipulations on a sequential data. You can group, sort, and perform other sequential data manipulations in template expressions.
Selector
stands for a lambda function returning a value and taking an enumeration item as its single argument.ComparableSelector
stands forSelector
returning IComparable.Predicate
stands forSelector
returning a boolean value (true or false).
Extention method | Examples and notes | |
---|---|---|
| persons.all(p => p.age < 50 ) | |
|
| |
| persons.any(p => p.name == "John Smith") | |
| persons.average(p => p.age) The input selector must return a value of any type that has predefined or user-defined addition and division operators. | |
|
An implicit reference conversion must exist between types of items of concatenated enumerations. | |
| persons.contains(otherPersons.first()) | |
| persons.count() | |
| persons.count(p => p.age > 30) | |
| persons.distinct() | |
| persons.first() | |
| persons.first(p => p.age > 30) | |
| persons.firstOrDefault() | |
| persons.firstOrDefault(p => p.age > 30) | |
|
Or persons.groupBy( p => new { age = p.age, count = p.children.Count() }) This method returns an enumeration of group objects. Each group has a unique key defined by the input selector and contains items of the source enumeration associated with this key. You can access the key of a group instance using the Key property. You can treat a group itself as an enumeration of items that the group contains. | |
| persons.last() | |
| persons.last(p => p.age > 100) | |
| persons.lastOrDefault() | |
| persons.lastOrDefault(p => p.age > 100) | |
| persons.max(p => p.age) | |
| persons.min(p => p.aage) | |
|
Or persons.orderBy(p => p.age) .thenByDescending(p => p.name) Or persons.orderBy(p => p.age) .thenByDescending(p => p.name) .thenBy(p => p.children.count()) This method returns an enumeration ordered by a single key. To specify additional ordering keys, you can use the following extension methods of an ordered enumeration:
| |
|
Or persons.orderByDescending(p => p.age) .thenByDescending(p => p.name) Or persons.orderByDescending(p => p.age) .thenByDescending(p => p.name) .thenBy(p => p.children.count()) See the previous note. | |
| persons.single() | |
| persons.single( p => p.name == "John Smith" ) | |
| persons.singleOrDefault() | |
|
| |
| persons.skip( 10 ) | |
| persons.skipWhile(p => p.age < 21 ) | |
|
The input selector must return a value of any type that has a predefined or user-defined addition operator. | |
| persons.take(5) | |
| persons.takeWhile(p => p.age < 50) | |
|
An implicit reference conversion must exist between types of items of united enumerations. | |
| persons.where(p => p.age > 18 ) |