cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Casting a Node to a c# object

Hey Neo / C# units... Now that Neo4JClient is obselete (hasn't been updated in over a year) I assume new devs like me are using bolt 4.0. I'm looking for a nice way to cast a node or relationship into one of my c# objects and this is the best solution I can find out there:

        var result = tx.Run(statementText);
        foreach(var record in result)
        {
            var nodeProps = JsonConvert.SerializeObject(record[0].As<INode>().Properties);
            users.Add(JsonConvert.DeserializeObject<User>(nodeProps));
        }

I've gotta think there's a better / more efficient way than the example above. Thx all!

0 REPLIES 0