Source

Neo4RestNet / Rest / Parsers / NodeArrayParser.cs

using System.Collections.Generic;
using Neo4RestNet.Api;
using Newtonsoft.Json.Linq;

namespace Neo4RestNet.Rest.Parsers
{
  internal class NodeArrayParser
  {
    private readonly NodeParser _nodeParser;

    internal NodeArrayParser()
    {
      _nodeParser = new NodeParser();
    }

    internal IEnumerable<INode> Parse(string resultFromNodeTraversal)
    {
      // The result consists of an array of nodes
      var nodes = JArray.Parse(resultFromNodeTraversal);

      foreach (var node in nodes)
      {
        yield return _nodeParser.Parse((JObject)node);
      }
    }
  }
}