Search Results for

    Show / Hide Table of Contents

    Class ValueEnumerableExtensions

    Extension methods for IValueEnumerable<T>.

    Inheritance
    System.Object
    ValueEnumerableExtensions
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: MoreStructures.Utilities
    Assembly: MoreStructures.dll
    Syntax
    public static class ValueEnumerableExtensions

    Methods

    | Improve this Doc View Source

    AsValue<T>(IEnumerable<T>)

    Wraps the provided enumerable into a IValueEnumerable<T>, which uses to check for equality.

    Declaration
    public static IValueEnumerable<T> AsValue<T>(this IEnumerable<T> enumerable)
    Parameters
    Type Name Description
    IEnumerable<T> enumerable

    The enumerable to wrap.

    Returns
    Type Description
    IValueEnumerable<T>

    A IValueEnumerable<T> wrapping the provided .

    Type Parameters
    Name Description
    T

    The type of objects of enumerable.

    Remarks

    Useful to preserve equality by value in records and other value structures which contain enumerable objects.
    Passing a System.String as enumerable will result in the instantiation of a specialized concretion of IValueEnumerable<T> which handles strings specifically: StringValueEnumerable.
    Time and Space Complexity are O(1), as this method doesn't iterate over enumerable.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX