From 319cf89a44ca24ef976da786fa78a5e70a783a66 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 4 Jun 2025 06:08:59 +0100 Subject: [PATCH] =?UTF-8?q?Update=20SqlEvaluator=20expression=20keyword=20?= =?UTF-8?q?resolver=20for=20using=20variables.=20=E2=80=A6=20(#6705)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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. --- src/modules/Elsa.Sql/Services/SqlEvaluator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/Elsa.Sql/Services/SqlEvaluator.cs b/src/modules/Elsa.Sql/Services/SqlEvaluator.cs index 10ee5a0df..3f0e4d724 100644 --- a/src/modules/Elsa.Sql/Services/SqlEvaluator.cs +++ b/src/modules/Elsa.Sql/Services/SqlEvaluator.cs @@ -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}}}}}.") }; }