API Browser

Method

ElementAtOrError

func ElementAtOrError<T, E>(index: int, errorFactory: () -> E) -> Result<T, E>

Declaring type: EnumerableOption<T>
Namespace: System.Linq
Assembly: Raven.Core.dll
Source file: LinqExtensions.rvn

Extension from EnumerableOption<T>.ElementAtOrError

Returns the element at index as Ok, or an error when the index is out of range.

Parameters

Name Type Description
self IEnumerable<T>
index Int32
errorFactory () -> E

Return value

Result<T, E>