runxc1 / MicroRuleEngine

A .Net Rule Engine for dynamically evaluating business rules compiled on the fly.
MIT License
185 stars 73 forks source link

The engine is unable to invoke Extension methods. Is this correct understanding? #34

Open MithunChopda opened 2 months ago

MithunChopda commented 2 months ago

When trying to invoke Extension methods, the engine throws method not found exception. I am assuming because typeof() returns the base type and thus the extensions methods are not visible. Is this correct understanding? Example: User.Identities.First() here method First is not found

jamescurran commented 2 months ago

That is correct. It's only designed to find instance methods.
I believe getting it to recognize an extension method using the instance method syntax would be quite difficult. It'll probably be easier to get it to recognize the method using the static method syntax: Enumerable.First(User.Identities), but even that would be a major change to the code.