Table of Contents

Class FuncExtensions

Namespace
LfrlAnvil.Extensions
Assembly
LfrlAnvil.Core.dll

Contains Func<TResult> extension methods.

public static class FuncExtensions
Inheritance
FuncExtensions
Inherited Members

Methods

IgnoreResult<T>(Func<T>)

Creates a new Action delegate based on the provided source, that invokes the source and discards its result.

[Pure]
public static Action IgnoreResult<T>(this Func<T> source)

Parameters

source Func<T>

Source delegate.

Returns

Action

New Action instance.

Type Parameters

T

Value type.

Memoize<T>(Func<IEnumerable<T>>)

Creates a new IMemoizedCollection<T> instance based on the provided source delegate.

[Pure]
public static IMemoizedCollection<T> Memoize<T>(this Func<IEnumerable<T>> source)

Parameters

source Func<IEnumerable<T>>

Source delegate.

Returns

IMemoizedCollection<T>

New IMemoizedCollection<T> instance that lazily materializes the result of the provided source.

Type Parameters

T

Value type.

ToLazy<T>(Func<T>)

Creates a new Lazy<T> instance based on the provided source delegate.

[Pure]
public static Lazy<T> ToLazy<T>(this Func<T> source)

Parameters

source Func<T>

Source delegate.

Returns

Lazy<T>

New Lazy<T> instance.

Type Parameters

T

Value type.