API Browser

Member group

ToDictionaryOrError

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

Overloads / Variants

ToDictionaryOrError

func ToDictionaryOrError<T, TKey, E>(keySelector: T -> TKey, errorFactory: Exception -> E) -> Result<Dictionary<TKey, T>, E>

Source file: LinqExtensions.rvn

Extension from EnumerableOption<T>.ToDictionaryOrError

Materializes the sequence as a dictionary and maps any exception to an error.

Parameters

Name Type Description
self IEnumerable<T>
keySelector T -> TKey
errorFactory Exception -> E

Return value

Result<Dictionary<TKey, T>, E>

ToDictionaryOrError

func ToDictionaryOrError<T, TKey, TValue, E>(keySelector: T -> TKey, elementSelector: T -> TValue, errorFactory: Exception -> E) -> Result<Dictionary<TKey, TValue>, E>

Source file: LinqExtensions.rvn

Extension from EnumerableOption<T>.ToDictionaryOrError

Materializes projected elements as a dictionary and maps any exception to an error.

Parameters

Name Type Description
self IEnumerable<T>
keySelector T -> TKey
elementSelector T -> TValue
errorFactory Exception -> E

Return value

Result<Dictionary<TKey, TValue>, E>