Show / Hide Table of Contents

    Class Extensions

    Contains the LINQ to JSON extension methods.

    Inheritance
    System.Object
    Extensions
    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: Bayat.Json.Linq
    Assembly: Bayat.Json.Runtime.dll
    Syntax
    public static class Extensions

    Methods

    | Improve this Doc View Source

    Ancestors<T>(IEnumerable<T>)

    Returns a collection of tokens that contains the ancestors of every token in the source collection.

    Declaration
    public static IJEnumerable<JToken> Ancestors<T>(this IEnumerable<T> source)
        where T : JToken
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    IJEnumerable<JToken>

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the ancestors of every token in the source collection.

    Type Parameters
    Name Description
    T

    The type of the objects in source, constrained to JToken.

    | Improve this Doc View Source

    AncestorsAndSelf<T>(IEnumerable<T>)

    Returns a collection of tokens that contains every token in the source collection, and the ancestors of every token in the source collection.

    Declaration
    public static IJEnumerable<JToken> AncestorsAndSelf<T>(this IEnumerable<T> source)
        where T : JToken
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    IJEnumerable<JToken>

    An System.Collections.Generic.IEnumerable<T> of JToken that contains every token in the source collection, the ancestors of every token in the source collection.

    Type Parameters
    Name Description
    T

    The type of the objects in source, constrained to JToken.

    | Improve this Doc View Source

    AsJEnumerable(IEnumerable<JToken>)

    Returns the input typed as IJEnumerable<T>.

    Declaration
    public static IJEnumerable<JToken> AsJEnumerable(this IEnumerable<JToken> source)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<JToken> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    IJEnumerable<JToken>

    The input typed as IJEnumerable<T>.

    | Improve this Doc View Source

    AsJEnumerable<T>(IEnumerable<T>)

    Returns the input typed as IJEnumerable<T>.

    Declaration
    public static IJEnumerable<T> AsJEnumerable<T>(this IEnumerable<T> source)
        where T : JToken
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    IJEnumerable<T>

    The input typed as IJEnumerable<T>.

    Type Parameters
    Name Description
    T

    The source collection type.

    | Improve this Doc View Source

    Children<T>(IEnumerable<T>)

    Returns a collection of child tokens of every array in the source collection.

    Declaration
    public static IJEnumerable<JToken> Children<T>(this IEnumerable<T> source)
        where T : JToken
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    IJEnumerable<JToken>

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the values of every token in the source collection.

    Type Parameters
    Name Description
    T

    The source collection type.

    | Improve this Doc View Source

    Children<T, U>(IEnumerable<T>)

    Returns a collection of converted child tokens of every array in the source collection.

    Declaration
    public static IEnumerable<U> Children<T, U>(this IEnumerable<T> source)
        where T : JToken
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<U>

    An System.Collections.Generic.IEnumerable<T> that contains the converted values of every token in the source collection.

    Type Parameters
    Name Description
    T

    The source collection type.

    U

    The type to convert the values to.

    | Improve this Doc View Source

    Convert<T, U>(T)

    Declaration
    public static U Convert<T, U>(this T token)
        where T : JToken
    Parameters
    Type Name Description
    T token
    Returns
    Type Description
    U
    Type Parameters
    Name Description
    T
    U
    | Improve this Doc View Source

    Convert<T, U>(IEnumerable<T>)

    Declaration
    public static IEnumerable<U> Convert<T, U>(this IEnumerable<T> source)
        where T : JToken
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<U>
    Type Parameters
    Name Description
    T
    U
    | Improve this Doc View Source

    Descendants<T>(IEnumerable<T>)

    Returns a collection of tokens that contains the descendants of every token in the source collection.

    Declaration
    public static IJEnumerable<JToken> Descendants<T>(this IEnumerable<T> source)
        where T : JContainer
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    IJEnumerable<JToken>

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the descendants of every token in the source collection.

    Type Parameters
    Name Description
    T

    The type of the objects in source, constrained to JContainer.

    | Improve this Doc View Source

    DescendantsAndSelf<T>(IEnumerable<T>)

    Returns a collection of tokens that contains every token in the source collection, and the descendants of every token in the source collection.

    Declaration
    public static IJEnumerable<JToken> DescendantsAndSelf<T>(this IEnumerable<T> source)
        where T : JContainer
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    IJEnumerable<JToken>

    An System.Collections.Generic.IEnumerable<T> of JToken that contains every token in the source collection, and the descendants of every token in the source collection.

    Type Parameters
    Name Description
    T

    The type of the objects in source, constrained to JContainer.

    | Improve this Doc View Source

    Properties(IEnumerable<JObject>)

    Returns a collection of child properties of every object in the source collection.

    Declaration
    public static IJEnumerable<JProperty> Properties(this IEnumerable<JObject> source)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<JObject> source

    An System.Collections.Generic.IEnumerable<T> of JObject that contains the source collection.

    Returns
    Type Description
    IJEnumerable<JProperty>

    An System.Collections.Generic.IEnumerable<T> of JProperty that contains the properties of every object in the source collection.

    | Improve this Doc View Source

    Value<U>(IEnumerable<JToken>)

    Converts the value.

    Declaration
    public static U Value<U>(this IEnumerable<JToken> value)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<JToken> value

    A JToken cast as a System.Collections.Generic.IEnumerable<T> of JToken.

    Returns
    Type Description
    U

    A converted value.

    Type Parameters
    Name Description
    U

    The type to convert the value to.

    | Improve this Doc View Source

    Value<T, U>(IEnumerable<T>)

    Converts the value.

    Declaration
    public static U Value<T, U>(this IEnumerable<T> value)
        where T : JToken
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> value

    A JToken cast as a System.Collections.Generic.IEnumerable<T> of JToken.

    Returns
    Type Description
    U

    A converted value.

    Type Parameters
    Name Description
    T

    The source collection type.

    U

    The type to convert the value to.

    | Improve this Doc View Source

    Values(IEnumerable<JToken>)

    Returns a collection of child values of every object in the source collection.

    Declaration
    public static IJEnumerable<JToken> Values(this IEnumerable<JToken> source)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<JToken> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    IJEnumerable<JToken>

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the values of every token in the source collection.

    | Improve this Doc View Source

    Values(IEnumerable<JToken>, Object)

    Returns a collection of child values of every object in the source collection with the given key.

    Declaration
    public static IJEnumerable<JToken> Values(this IEnumerable<JToken> source, object key)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<JToken> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    System.Object key

    The token key.

    Returns
    Type Description
    IJEnumerable<JToken>

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the values of every token in the source collection with the given key.

    | Improve this Doc View Source

    Values<U>(IEnumerable<JToken>)

    Returns a collection of converted child values of every object in the source collection.

    Declaration
    public static IEnumerable<U> Values<U>(this IEnumerable<JToken> source)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<JToken> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<U>

    An System.Collections.Generic.IEnumerable<T> that contains the converted values of every token in the source collection.

    Type Parameters
    Name Description
    U

    The type to convert the values to.

    | Improve this Doc View Source

    Values<U>(IEnumerable<JToken>, Object)

    Returns a collection of converted child values of every object in the source collection with the given key.

    Declaration
    public static IEnumerable<U> Values<U>(this IEnumerable<JToken> source, object key)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<JToken> source

    An System.Collections.Generic.IEnumerable<T> of JToken that contains the source collection.

    System.Object key

    The token key.

    Returns
    Type Description
    System.Collections.Generic.IEnumerable<U>

    An System.Collections.Generic.IEnumerable<T> that contains the converted values of every token in the source collection with the given key.

    Type Parameters
    Name Description
    U

    The type to convert the values to.

    | Improve this Doc View Source

    Values<T, U>(IEnumerable<T>, Object)

    Declaration
    public static IEnumerable<U> Values<T, U>(this IEnumerable<T> source, object key)
        where T : JToken
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<T> source
    System.Object key
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<U>
    Type Parameters
    Name Description
    T
    U
    • Improve this Doc
    • View Source
    • 0 Comments