Closed wbuck closed 1 year ago
Seems to me we just need something like the following:
private const string DollarIt = "$it";
private const string DollarThis = "$this";
and
private IExpressionPart GetNonResourceRangeVariableReferenceNodeFilterPart(NonResourceRangeVariableReferenceNode nonResourceRangeVariableReferenceNode)
=> new ParameterOperator
(
parameters,
ReplaceDollarThisParameterName(nonResourceRangeVariableReferenceNode.RangeVariable.Name)
);
private IExpressionPart GetResourceRangeVariableReferenceNodeFilterPart(ResourceRangeVariableReferenceNode resourceRangeVariableReferenceNode)
=> new ParameterOperator
(
parameters,
ReplaceDollarThisParameterName(resourceRangeVariableReferenceNode.RangeVariable.Name)
);
private static string ReplaceDollarThisParameterName(string rangeVariableName) => rangeVariableName == DollarThis ? DollarIt : rangeVariableName;
Yeah, I think originally when I wrote this my thought process was to allow queries like this:
$it => $it.SomeValueCollection.Any($this => $this gt $it.MyValue)
Or using $root
potentially`.
Now in those cases there is nothing setup to create capturing lambda's so the above query wouldn't work.
I'll simplify the code.
@BlaiseD Done
Made some minor changes - better to leave a public method in until a major version release.
Thanks
This addresses request: #169