DesignForms
TLinq Class Reference

Language-Integrated Query (LINQ) contains set of functions for work with arrays/lists/collections More...

Public Member Functions

double Max (IEnumerable List)
 Computes the maximum value of a sequence of numeric values. More...
 
double Max (IEnumerable List, Func< object, object > selector)
 Computes the maximum value of a sequence of elements converted by lambda expression to numeric value. More...
 
object MaxMember (IEnumerable List, Func< object, object > selector)
 Return member with max property More...
 
double Min (IEnumerable List)
 Computes the minimum value of a sequence of numeric values. More...
 
double Min (IEnumerable List, Func< object, object > selector)
 Computes the minimum value of a sequence of elements converted by lambda expression to numeric value. More...
 
object MinMember (IEnumerable List, Func< object, object > selector)
 Return member with min property More...
 
double Sum (IEnumerable List)
 Computes the sum of a sequence of numeric values. More...
 
double Sum (IEnumerable List, Func< object, object > selector)
 Computes the sum of a sequence of elements converted by lambda expression to numeric value. More...
 
double Average (IEnumerable List)
 Computes the average of a sequence of numeric values. More...
 
double Average (IEnumerable List, Func< object, object > selector)
 Computes the average of a sequence of elements converted by lambda expression to numeric value. More...
 
IEnumerable< object > Select (IEnumerable List, Func< object, object > selector)
 Projects each element of a sequence into a new form defined by selector. More...
 
IEnumerable< object > Where (IEnumerable List, Func< object, object > predicate)
 Filters a sequence of values based on a predicate. More...
 
bool Contains (IEnumerable List, Func< object, object > comparer)
 Determines whether a sequence contains a element matching comparer criteria. More...
 
object First (IEnumerable List)
 Returns the first element of a sequence. More...
 
object First (IEnumerable List, Func< object, object > predicate)
 Returns the first element in a sequence that satisfies a specified condition. More...
 
object FirstOrDefault (IEnumerable List, Func< object, object > predicate)
 Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. More...
 
object Last (IEnumerable List)
 Returns the last element of a sequence. More...
 
object Last (IEnumerable List, Func< object, object > predicate)
 Returns the last element of a sequence that satisfies a specified condition. More...
 
object LastOrDefault (IEnumerable List, Func< object, object > predicate)
 Returns the last element of the sequence that satisfies a condition or a default value if no such element is found. More...
 
IEnumerable< object > OrderBy (IEnumerable List, Func< object, object > selector)
 Sorts the elements of a sequence in ascending order according to a selector. More...
 
IEnumerable< object > OrderByDescending (IEnumerable List, Func< object, object > selector)
 Sorts the elements of a sequence in descending order according to a selector. More...
 
IEnumerable< object > Skip (IEnumerable List, double Count)
 Bypasses a specified number of elements in a sequence and then returns the remaining elements. More...
 
IEnumerable< object > Distinct (IEnumerable List)
 Returns distinct elements from a sequence by using the default equality comparer to compare values. More...
 
IEnumerable< object > ConcatLists (IEnumerable Lists, Func< object, object > selector)
 Concat list of lists into one sequence More...
 
List< object > ToList (IEnumerable List)
 Convert IEnumerable sequence to the list More...
 

Detailed Description

Language-Integrated Query (LINQ) contains set of functions for work with arrays/lists/collections

Member Function Documentation

double Average ( IEnumerable  List)

Computes the average of a sequence of numeric values.

Parameters
ListCollection of elements on which the operation will be applied.
Returns
The average of the sequence of values.
double Average ( IEnumerable  List,
Func< object, object >  selector 
)

Computes the average of a sequence of elements converted by lambda expression to numeric value.

Parameters
ListCollection of elements on which the operation will be applied.
selectorOperation which will be applied on each element of the collection.
Returns
The average of the sequence of values.
IEnumerable<object> ConcatLists ( IEnumerable  Lists,
Func< object, object >  selector 
)

Concat list of lists into one sequence

Parameters
ListsList of enumerable sequences (list of lists)
selectorSelector applied to each list in the sequence
Returns
Sequence of all elemetns in all lists.
bool Contains ( IEnumerable  List,
Func< object, object >  comparer 
)

Determines whether a sequence contains a element matching comparer criteria.

Parameters
ListCollection of elements on which the operation will be applied.
comparerCondition describing requested element.
Returns
TRUE if the source sequence contains an element that satisfies a specified condition; otherwise FALSE.
IEnumerable<object> Distinct ( IEnumerable  List)

Returns distinct elements from a sequence by using the default equality comparer to compare values.

Parameters
ListCollection of elements on which the operation will be applied.
Returns
An array that contains distinct elements from the source sequence.
object First ( IEnumerable  List)

Returns the first element of a sequence.

Parameters
ListCollection of elements on which the operation will be applied.
Returns
Returns the first element of a sequence.
object First ( IEnumerable  List,
Func< object, object >  predicate 
)

Returns the first element in a sequence that satisfies a specified condition.

Parameters
ListCollection of elements on which the operation will be applied.
predicateA function to test each element for a condition.
Returns
Returns the first element in a sequence that satisfies a specified condition.
object FirstOrDefault ( IEnumerable  List,
Func< object, object >  predicate 
)

Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.

Parameters
ListCollection of elements on which the operation will be applied.
predicateA function to test each element for a condition.
Returns
Returns the first element of the sequence that satisfies a condition or a default value if no such element is found.
object Last ( IEnumerable  List)

Returns the last element of a sequence.

Parameters
ListCollection of elements on which the operation will be applied.
Returns
Returns the last element of a sequence.
object Last ( IEnumerable  List,
Func< object, object >  predicate 
)

Returns the last element of a sequence that satisfies a specified condition.

Parameters
ListCollection of elements on which the operation will be applied.
predicateA function to test each element for a condition.
Returns
Returns the last element of a sequence that satisfies a specified condition.
object LastOrDefault ( IEnumerable  List,
Func< object, object >  predicate 
)

Returns the last element of the sequence that satisfies a condition or a default value if no such element is found.

Parameters
ListCollection of elements on which the operation will be applied.
predicateA function to test each element for a condition.
Returns
Returns the last element of the sequence that satisfies a condition or a default value if no such element is found.
double Max ( IEnumerable  List)

Computes the maximum value of a sequence of numeric values.

Parameters
ListCollection of elements on which the operation will be applied.
Returns
The maximum of the sequence of values.
double Max ( IEnumerable  List,
Func< object, object >  selector 
)

Computes the maximum value of a sequence of elements converted by lambda expression to numeric value.

Parameters
ListCollection of elements on which the operation will be applied.
selectorOperation which will be applied on each element of the collection.
Returns
The maximum of the sequence of values.
object MaxMember ( IEnumerable  List,
Func< object, object >  selector 
)

Return member with max property

Parameters
ListList of members to iterated
selectorDefinition of property used to identify extreme member
Returns
Member with max property
double Min ( IEnumerable  List)

Computes the minimum value of a sequence of numeric values.

Parameters
ListCollection of elements on which the operation will be applied.
Returns
The minimum of the sequence of values.
double Min ( IEnumerable  List,
Func< object, object >  selector 
)

Computes the minimum value of a sequence of elements converted by lambda expression to numeric value.

Parameters
ListCollection of elements on which the operation will be applied.
selectorOperation which will be applied on each element of the collection.
Returns
The minimum of the sequence of values.
object MinMember ( IEnumerable  List,
Func< object, object >  selector 
)

Return member with min property

Parameters
ListList of members to iterated
selectorDefinition of property used to identify extreme member
Returns
Member with min property
IEnumerable<object> OrderBy ( IEnumerable  List,
Func< object, object >  selector 
)

Sorts the elements of a sequence in ascending order according to a selector.

Parameters
ListCollection of elements on which the operation will be applied.
selectorOperation which will be applied on each element of the collection.
Returns
An array whose elements are sorted in ascending order according to the selector.
IEnumerable<object> OrderByDescending ( IEnumerable  List,
Func< object, object >  selector 
)

Sorts the elements of a sequence in descending order according to a selector.

Parameters
ListCollection of elements on which the operation will be applied.
selectorOperation which will be applied on each element of the collection.
Returns
An array whose elements are sorted in descending order according to the selector.
IEnumerable<object> Select ( IEnumerable  List,
Func< object, object >  selector 
)

Projects each element of a sequence into a new form defined by selector.

Parameters
ListCollection of elements on which the operation will be applied.
selectorOperation which will be applied on each element of the collection.
Returns
An array whose elements are the result of invoking the transform function on each element of source.
IEnumerable<object> Skip ( IEnumerable  List,
double  Count 
)

Bypasses a specified number of elements in a sequence and then returns the remaining elements.

Parameters
ListCollection of elements on which the operation will be applied.
CountThe number of elements to skip before returning the remaining elements.
Returns
An array that contains the elements that occur after the specified index in the input sequence.
double Sum ( IEnumerable  List)

Computes the sum of a sequence of numeric values.

Parameters
ListCollection of elements on which the operation will be applied.
Returns
The sum of the sequence of values.
double Sum ( IEnumerable  List,
Func< object, object >  selector 
)

Computes the sum of a sequence of elements converted by lambda expression to numeric value.

Parameters
ListCollection of elements on which the operation will be applied.
selectorOperation which will be applied on each element of the collection.
Returns
The sum of the sequence of values.
List<object> ToList ( IEnumerable  List)

Convert IEnumerable sequence to the list

Parameters
ListEnumerable sequence of objects to be converted to the list.
Returns
List of objects from the sequence
IEnumerable<object> Where ( IEnumerable  List,
Func< object, object >  predicate 
)

Filters a sequence of values based on a predicate.

Parameters
ListCollection of elements on which the operation will be applied.
predicateA function to test each element for a condition.
Returns
An array that contains elements from the input sequence that satisfy the condition.