Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot add variable with null value #104

Open
MHDSAEEDRABID opened this issue Feb 5, 2023 · 0 comments
Open

Cannot add variable with null value #104

MHDSAEEDRABID opened this issue Feb 5, 2023 · 0 comments

Comments

@MHDSAEEDRABID
Copy link

MHDSAEEDRABID commented Feb 5, 2023

I want to try to evaluate this simple expression .
in this code I've added variable to VariableCollection
variable name : "startDate" .
variable value : null
note : the type of Variable Collection (Dictionary) value is object

the issue : I got this exception
System.ArgumentNullException: 'Value cannot be null. (Parameter 'value')'

ExpressionContext context = new ExpressionContext();
string expression = @"(startDate > ""2020-05-01""))";

var varaibles = context.Variables;
//Add variable with name startDate with null value
varaibles.Add("startDate",null);

var compile = context.CompileGeneric<bool>(expression);
var result = compile.Evaluate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant