Class CoreEnumerableExtensions
Extensions for System.Collections.Generic.IEnumerable<> which aware about Eco.Core collections.
Inheritance
System.Object
CoreEnumerableExtensions
Assembly: Eco.Core.dll
Syntax
public static class CoreEnumerableExtensions : Object
Methods
AsSnapshot<T>(IEnumerable<T>)
Returns snapshot of enumerable
using optimized representation if possible.
It assumes that non thread safe collections (System.Collections.Generic.List<>, System.Collections.Generic.HashSet<> and System.Collections.Generic.Queue<>) not modified from another threads and so returns as is.
For ThreadSafeList<T>, ThreadSafeHashSet<T> and ThreadSafeQueue<T> it uses Snapshot
property.
With snapshot it guaranteed that you won't have multiple enumeration what ensures stable result and performance for complex LINQ chains.
It also ensures you won't have collection modified from another threads to avoid inconsistent results.
Declaration
public static IEnumerable<T> AsSnapshot<T>(this IEnumerable<T> enumerable)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<T> |
enumerable |
|
Returns
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
Type Parameters
EmptySet<T>()
Declaration
public static IReadOnlySet<T> EmptySet<T>()
Returns
Type |
Description |
System.Collections.Generic.IReadOnlySet<T> |
|
Type Parameters