Open Rleahy opened 5 years ago
@Rleahy you can either use json.net JObject
or dynamic
JObject
version
var result = GraphDB.DB.CreateStatement<JObject>(Query,perams).ToList();
foreach (var r in result)
{
double Prob = r.Value<double>("Prob");
}
dynamic
version
var result = GraphDB.DB.CreateStatement<dynamic>(Query,perams).ToList();
foreach (var r in result)
{
double Prob = r.Prob;
}
Thanks for the fast reply much appreciated its working now :)
On Mon, Nov 5, 2018 at 1:23 PM raoof hojat notifications@github.com wrote:
@Rleahy https://github.com/Rleahy you can either use json.net JObject or dynamic
JObject version
var result = GraphDB.DB.CreateStatement
(Query,perams).ToList();foreach (var r in result) { double Prob = r.Value ("Prob"); } dynamic version
var result = GraphDB.DB.CreateStatement
(Query,perams).ToList();foreach (var r in result) { double Prob = r.Prob; } — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ra0o0f/arangoclient.net/issues/113#issuecomment-435871851, or mute the thread https://github.com/notifications/unsubscribe-auth/Aj4Bo8Gf5i6l0VCDgODrAWTZ2-aEmesfks5usDvagaJpZM4YOZyi .
Hi i'm trying to get the results of a query as follows
Because i do no know the type at compile time i can't return the results using generics. How would i get the result of this query as a raw string or dynamic object?
When i attempt to cast to string or dynamic i get errors as soon as i start trying to pull the results i get ArangoDB.Client.ArangoServerException 'AQL: collection or array expected as operand to FOR loop; you specified type 'string' with content '"Binds"' (while optimizing ast). ErrorNumber: 1563 HttpStatusCode: 400'