Type extension
EnumerableOption<T>
extension EnumerableOption<T> for IEnumerable<T>
Namespace: System.Linq
Assembly: Raven.Core.dll
Source file: LinqExtensions.rvn
Provides Optional- and Result-returning sequence operations.
Receiver
IEnumerable<T>
Type parameters
| Name | Description |
|---|---|
T |
The sequence element type. |
Methods
26 items
Extension member:
ElementAtOrError<T, E>(index: int, errorFactory: () -> E) -> Result<T, E>
Returns the element at `index` as `Ok`, or an error when the index is out of range.
Extension from EnumerableOption<T>.ElementAtOrError
Extension member:
ElementAtOrNone<T>(index: int) -> Optional<T>
Returns the element at `index` as `Some`, or `None` when the index is out of range.
Extension from EnumerableOption<T>.ElementAtOrNone
Extension member:
FirstOrError<T, E>(errorFactory: () -> E) -> Result<T, E>
Returns the first element as `Ok`, or an error produced by `errorFactory`.
Extension from EnumerableOption<T>.FirstOrError
Extension member:
FirstOrError<T, E>(predicate: T -> bool, errorFactory: () -> E) -> Result<T, E>
Returns the first matching element as `Ok`, or an error produced by `errorFactory`.
Extension from EnumerableOption<T>.FirstOrError
Extension member:
FirstOrNone<T>(predicate: T -> bool) -> Optional<T>
Returns the first matching element as `Some`, or `None` when no element matches.
Extension from EnumerableOption<T>.FirstOrNone
Extension member:
FirstOrNone<T>() -> Optional<T>
Returns the first element as `Some`, or `None` for an empty sequence.
Extension from EnumerableOption<T>.FirstOrNone
Extension member:
LastOrError<T, E>(errorFactory: () -> E) -> Result<T, E>
Returns the last element as `Ok`, or an error produced by `errorFactory`.
Extension from EnumerableOption<T>.LastOrError
Extension member:
LastOrError<T, E>(predicate: T -> bool, errorFactory: () -> E) -> Result<T, E>
Returns the last matching element as `Ok`, or an error produced by `errorFactory`.
Extension from EnumerableOption<T>.LastOrError
Extension member:
LastOrNone<T>(predicate: T -> bool) -> Optional<T>
Returns the last matching element as `Some`, or `None` when no element matches.
Extension from EnumerableOption<T>.LastOrNone
Extension member:
LastOrNone<T>() -> Optional<T>
Returns the last element as `Some`, or `None` for an empty sequence.
Extension from EnumerableOption<T>.LastOrNone
Extension member:
SingleOrError<T, E>(errorFactory: () -> E) -> Result<T, E>
Returns the only element as `Ok`, or an error unless exactly one element exists.
Extension from EnumerableOption<T>.SingleOrError
Extension member:
SingleOrError<T, E>(errorIfNone: () -> E, errorIfMany: () -> E) -> Result<T, E>
Returns the only element as `Ok`, distinguishing empty and multiple-element errors.
Extension from EnumerableOption<T>.SingleOrError
Extension member:
SingleOrError<T, E>(predicate: T -> bool, errorFactory: () -> E) -> Result<T, E>
Returns the only matching element as `Ok`, or an error unless exactly one element matches.
Extension from EnumerableOption<T>.SingleOrError
Extension member:
SingleOrError<T, E>(predicate: T -> bool, errorIfNone: () -> E, errorIfMany: () -> E) -> Result<T, E>
Returns the only matching element as `Ok`, distinguishing no-match and multiple-match errors.
Extension from EnumerableOption<T>.SingleOrError
Extension member:
SingleOrNone<T>(predicate: T -> bool) -> Optional<T>
Returns the only matching element as `Some`, or `None` unless exactly one element matches.
Extension from EnumerableOption<T>.SingleOrNone
Extension member:
SingleOrNone<T>() -> Optional<T>
Returns the only element as `Some`, or `None` unless exactly one element exists.
Extension from EnumerableOption<T>.SingleOrNone
Extension member:
ToArrayOrError<T, E>(errorFactory: Exception -> E) -> Result<T[], E>
Materializes the sequence as an array and maps any exception to an error.
Extension from EnumerableOption<T>.ToArrayOrError
Extension member:
ToArrayOrException<T>() -> Result<T[], Exception>
Materializes the sequence as an array and captures any exception as an error.
Extension from EnumerableOption<T>.ToArrayOrException
Extension member:
ToDictionaryOrError<T, TKey, E>(keySelector: T -> TKey, errorFactory: Exception -> E) -> Result<Dictionary<TKey, T>, E>
Materializes the sequence as a dictionary and maps any exception to an error.
Extension from EnumerableOption<T>.ToDictionaryOrError
Extension member:
ToDictionaryOrError<T, TKey, TValue, E>(keySelector: T -> TKey, elementSelector: T -> TValue, errorFactory: Exception -> E) -> Result<Dictionary<TKey, TValue>, E>
Materializes projected elements as a dictionary and maps any exception to an error.
Extension from EnumerableOption<T>.ToDictionaryOrError
Extension member:
ToDictionaryOrException<T, TKey, TValue>(keySelector: T -> TKey, elementSelector: T -> TValue) -> Result<Dictionary<TKey, TValue>, Exception>
Materializes projected elements as a dictionary and captures any exception as an error.
Extension from EnumerableOption<T>.ToDictionaryOrException
Extension member:
ToDictionaryOrException<T, TKey>(keySelector: T -> TKey) -> Result<Dictionary<TKey, T>, Exception>
Materializes the sequence as a dictionary and captures any exception as an error.
Extension from EnumerableOption<T>.ToDictionaryOrException
Extension member:
ToHashSetOrError<T, E>(errorFactory: Exception -> E) -> Result<HashSet<T>, E>
Materializes the sequence as a hash set and maps any exception to an error.
Extension from EnumerableOption<T>.ToHashSetOrError
Extension member:
ToHashSetOrException<T>() -> Result<HashSet<T>, Exception>
Materializes the sequence as a hash set and captures any exception as an error.
Extension from EnumerableOption<T>.ToHashSetOrException
Extension member:
ToListOrError<T, E>(errorFactory: Exception -> E) -> Result<List<T>, E>
Materializes the sequence as a list and maps any exception to an error.
Extension from EnumerableOption<T>.ToListOrError
Extension member:
ToListOrException<T>() -> Result<List<T>, Exception>
Materializes the sequence as a list and captures any exception as an error.
Extension from EnumerableOption<T>.ToListOrException