Json.NET - Quick Starts & API Documentation
Ancestors<(Of <(<'T>)>)> Method (source)
Namespaces ► Newtonsoft.Json.Linq ► Extensions ► Ancestors<(Of <<'(T>)>>)(IEnumerable<(Of <<'(T>)>>))
Returns a collection of tokens that contains the ancestors of every token in the source collection.

C# | Visual Basic | Visual C++ |
public static IJEnumerable<JToken> Ancestors<T>( this IEnumerable<T> source ) where T : JToken
<ExtensionAttribute> _ Public Shared Function Ancestors(Of T As JToken) ( _ source As IEnumerable(Of T) _ ) As IJEnumerable(Of JToken)
[ExtensionAttribute] public: generic<typename T> where T : JToken static IJEnumerable<JToken^>^ Ancestors( IEnumerable<T>^ source )

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

- source (IEnumerable<(Of <(<'T>)>)>)
- An IEnumerable<(Of <(<'T>)>)> of JToken that contains the source collection.

An IEnumerable<(Of <(<'T>)>)> of JToken that contains the ancestors of every node in the source collection.

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<(Of <(<'T>)>)>. When you use instance method syntax to call this method, omit the first parameter.