Show / Hide Table of Contents

Class CoreEnumerableExtensions

Extensions for System.Collections.Generic.IEnumerable<> which aware about Eco.Core collections.

Inheritance
System.Object
CoreEnumerableExtensions
Namespace: Eco.Core.Utils
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
Name Description
T

EmptySet<T>()

Declaration
public static IReadOnlySet<T> EmptySet<T>()
Returns
Type Description
System.Collections.Generic.IReadOnlySet<T>
Type Parameters
Name Description
T
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾