Infohazard.Core 1.4.1
Infohazard Core Utility Library
Loading...
Searching...
No Matches
Infohazard.Core.EnumerableUtility Class Reference

Contains various static methods for working with sequences, extending the functionality of LINQ. More...

Public Member Functions

delegate bool SelectWhereDelegate< in T1, T2 > (T1 input, out T2 output)
 Delegate for functions that perform both a select/map and where/filter operation. More...
 

Static Public Member Functions

static IEnumerable< T2 > SelectWhere< T1, T2 > (this IEnumerable< T1 > input, SelectWhereDelegate< T1, T2 > selectionDelegate)
 Perform select/map and where/filter operations on a sequence with a single function. More...
 
static T2 FirstOrDefaultWhere< T1, T2 > (this IEnumerable< T1 > input, SelectWhereDelegate< T1, T2 > selectionDelegate)
 Perform select/map and where/filter operations on a sequence with a single function, and returns the result of the select operation for the first passing element. More...
 
static int IndexOf< T > (this IReadOnlyList< T > list, in T item)
 IndexOf operation for an IReadOnlyList, which is not included in .NET. More...
 

Detailed Description

Contains various static methods for working with sequences, extending the functionality of LINQ.

Member Function Documentation

◆ FirstOrDefaultWhere< T1, T2 >()

static T2 Infohazard.Core.EnumerableUtility.FirstOrDefaultWhere< T1, T2 > ( this IEnumerable< T1 >  input,
SelectWhereDelegate< T1, T2 >  selectionDelegate 
)
static

Perform select/map and where/filter operations on a sequence with a single function, and returns the result of the select operation for the first passing element.

Parameters
inputThe input sequence.
selectionDelegateThe delegate to use.
Template Parameters
T1Input type of the delegate.
T2Output type of the select operation.
Returns
The result of the select operation for the first passing element.

◆ IndexOf< T >()

static int Infohazard.Core.EnumerableUtility.IndexOf< T > ( this IReadOnlyList< T >  list,
in T  item 
)
static

IndexOf operation for an IReadOnlyList, which is not included in .NET.

This cannot take into account custom equality comparers.

Parameters
listList to search.
itemItem to search for.
Template Parameters
TType of items in the list.
Returns
The index of the item, or -1 if not found.

◆ SelectWhere< T1, T2 >()

static IEnumerable< T2 > Infohazard.Core.EnumerableUtility.SelectWhere< T1, T2 > ( this IEnumerable< T1 >  input,
SelectWhereDelegate< T1, T2 >  selectionDelegate 
)
static

Perform select/map and where/filter operations on a sequence with a single function.

Parameters
inputThe input sequence.
selectionDelegateThe delegate to use.
Template Parameters
T1Input type of the delegate.
T2Output type of the select operation.
Returns
The resulting sequence.

◆ SelectWhereDelegate< in T1, T2 >()

delegate bool Infohazard.Core.EnumerableUtility.SelectWhereDelegate< in T1, T2 > ( T1  input,
out T2  output 
)

Delegate for functions that perform both a select/map and where/filter operation.

Template Parameters
T1Input type of the function.
T2Output type of the select operation.

The documentation for this class was generated from the following file: