Show / Hide Table of Contents

    Class EnumerableExtensions

    Extensions for IEnumerable

    Inheritance
    System.Object
    EnumerableExtensions
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Hsl.Xrm.Sdk
    Assembly: Hsl.Xrm.Sdk.Core.dll
    Syntax
    public static class EnumerableExtensions

    Methods

    Batch<TSource>(IEnumerable<TSource>, Int32)

    Breaks up an IEnumerable into batches.

    Declaration
    public static IEnumerable<TSource[]> Batch<TSource>(this IEnumerable<TSource> source, int size)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TSource> source
    System.Int32 size
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<TSource[]>
    Type Parameters
    Name Description
    TSource

    SubArray<T>(T[], Int32, Int32)

    Returns a subset of the source array based on the provided arguments. If offset + maxLength is greater than the length of the source array, then the length of the resulting array will be the difference between the source array length and the offset. For example, calling SubArray with offset = 2 and maxLength = 5 on this array ["a", "b", "c", "d"] will result in ["c", "d"].

    Declaration
    public static T[] SubArray<T>(this T[] sourceArray, int offset, int maxLength)
    Parameters
    Type Name Description
    T[] sourceArray

    The array from which the subset will be pulled

    System.Int32 offset

    The zero-based offset for the starting point of the sub array

    System.Int32 maxLength

    The maximum length of the array to be returned

    Returns
    Type Description
    T[]

    An array that is a subset of the source array

    Type Parameters
    Name Description
    T

    The type of objects in the array

    Back to top Hsl.Xrm.Sdk