I don't know if my question is about c# and casting or related to Gremlin.net Library return Types. I am using this query to get vertices with their db ids.
g.V().As("vertex").ValueMap<IDictionary<string, object>>()
.As("properties").Select<object>("vertex", "properties")
.ToList()
properties is a list of attribute of the vertex. when I try to get the value of any property I found that its type is object with the below definition
property.Value =
{System.Linq.Enumerable.SelectIListIterator< Newtonsoft.Json.Linq.JToken, object>}
I can't find a way to cast it to get the value. Thanks in advance.
To get the value from {System.Linq.Enumerable.SelectIListIterator< Newtonsoft.Json.Linq.JToken, object>} object you can use:
(property.Value as IEnumerable<object>).Cast<object>().ToList()
this will return List< object>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With