MicroRuleEngine icon indicating copy to clipboard operation
MicroRuleEngine copied to clipboard

Compatibility w/ IConfiguration

Open mguinness opened this issue 4 years ago • 4 comments

I had to tweak the rule class to change Inputs field from IEnumerable to IList for compatibility w/ IConfiguration. I updated tests and also added section to README for details in use.

mguinness avatar Jan 22 '21 21:01 mguinness

I can't see how I'd implement the Inputs property without used a List<> or an array as the backing store, so this shouldn't be a problem.

jamescurran avatar Jan 22 '21 21:01 jamescurran

If I need the opposite of IsInInput is there a way to do that other than creating a new expression like below?

case "NotInInput":
    return Expression.Not(Expression.Call(Expression.Constant(rule.Inputs.ToList()),
                            _miListContains.Value,
                            propExpression));

Or maybe add a new boolean field called Negate on Rule class that would invoke Expression.Not if true?

mguinness avatar Jan 23 '21 00:01 mguinness

@jamescurran Do you think that this can be merged, do you need anything else from me?

mguinness avatar Jan 27 '21 20:01 mguinness

@jamescurran Any update on if this change to support the JSON configuration provider can be merged?

mguinness avatar Mar 22 '21 18:03 mguinness