Open zhenlei520 opened 3 months ago
If I introduce a value of type Dictionary<string,string>, I can use . in Expression to get the value of the specified key.
For example: My rule engine type is
{ public Dictionary<string, string> Dimensions { get; set; } }
where the value of Dimensions is
{"name":"tony"}
According to my understanding Expression should be
metadata.Dimensions.Any(d=>d.Key=="snakeTest" && d.Value=="tony")
However, during actual use, I found that it is also feasible to write as follows metadata.Dimensions.name == "tony"
Why is this happening? Does RulesEngine do any special processing?
you need to register IEnumerable so that Any can work
If I introduce a value of type Dictionary<string,string>, I can use . in Expression to get the value of the specified key.
For example: My rule engine type is
where the value of Dimensions is
According to my understanding Expression should be
However, during actual use, I found that it is also feasible to write as follows metadata.Dimensions.name == "tony"
Why is this happening? Does RulesEngine do any special processing?