You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to call context.Execute() on a method that requires a Dictionary<string, object> to be passed in. When invoked, I received the following message:
No applicable member has been found for the expression
If I change the parameter passed in to something simple like a string, I'm able to call the method without issue. I've also tried to pass in a Dictionary<string, string> and receive the same message. Here's a pared down version of the code:
public class ExpressionStringLibrary : IDisposable
{
private Dictionary<string, object> _interpolationValDict;
private string _testString;
// This call fails with the error described above
public void SetInterpolationValDict(Dictionary<string, object> interpolationValDict) => _interpolationValDict = interpolationValDict;
// This call succeeds with the error described above
public void SetInterpolationValDictWITHSTRING(string testString) => _testString = testString;
}
Invocation:
// Get eval context
var context = new EvalContext();
// Register static helper
context.RegisterGlobalVariable("exprStrLib", new ExpressionStringLibrary(), true);
// Fails
var interpolationValues = new Dictionary<string, object>();
context.Execute("SetInterpolationValDict({0})", interpolationValues);
// Succeeds
context.Execute("SetInterpolationValDictWITHSTRING({0})", "test");
Should I be able to pass a Dictionary<string, object>?
The text was updated successfully, but these errors were encountered:
I'm trying to call
context.Execute()
on a method that requires aDictionary<string, object>
to be passed in. When invoked, I received the following message:No applicable member has been found for the expression
If I change the parameter passed in to something simple like a string, I'm able to call the method without issue. I've also tried to pass in a
Dictionary<string, string>
and receive the same message. Here's a pared down version of the code:Invocation:
Should I be able to pass a
Dictionary<string, object>
?The text was updated successfully, but these errors were encountered: