Update SqlEvaluator expression keyword resolver for using variables. … (#6705)

* Update SqlEvaluator expression keyword resolver for using variables. Changes from 'Variables.' to 'Variable.' to match other properties singular naming convention.

* Fix substring index for variable retrieval.
This commit is contained in:
Matt 2025-06-04 06:08:59 +01:00 committed by GitHub
parent c5d312f04c
commit 319cf89a44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,7 +85,7 @@ public class SqlEvaluator() : ISqlEvaluator
"LastResult" => expressionContext.GetLastResult(),
var i when i.StartsWith("Input.") => executionContext.Input.TryGetValue(i.Substring(6), out var v) ? v : null,
var o when o.StartsWith("Output.") => executionContext.Output.TryGetValue(o.Substring(7), out var v) ? v : null,
var v when v.StartsWith("Variables.") => executionContext.Variables.FirstOrDefault(x => x.Name == v.Substring(10), null)?.Value ?? null,
var v when v.StartsWith("Variable.") => expressionContext.GetVariableInScope(v.Substring(9)) ?? null,
_ => throw new NullReferenceException($"No matching property found for {{{{{key}}}}}.")
};
}