delegateas/ExpressionEngine

Feature : Alias Map

Closed this issue ยท 4 comments

We based alot of functions of Power Automate, which makes sense. But generally writing my expressions i write eq() as a shorthand for equal.

Would properly be good to be able to just rename or alias functions in a project without having to implement it again.

I suggest we implement a service that can registered to map one function name to another.

Good idea ๐Ÿ’ก and not against, we just have to keep it true with Power Automate, since it is the core base - but we should still allow other use cases to be easy.

This could be combined with #47 to replace the current way functions are registered and 'retrieved', added a metadata class with shorthands, i.e. eq => equal, could be a good solution.

The use of shorthands should be controlled as an option, so it can be disregarded, and an error can be thrown, if ExpressionEngine is being used to test Power Automate flows.

I don't think we should bloat the current way functions are registered and retrieved, but instead recreate it properly :D

We agree,

i am thinking

var services = new ServiceCollection();
services.addExpressionEngine();

services.AddFunctionMap<MyFunctionMap>();

----

class MyFunctionMap : IFunctionMapper
{

       public string ResolveFunctionName(string name){
                  //logic to map names
       }

}

class DefaultFunctionMap : IFunctionMapper
{
 public string ResolveFunctionName(string name) => name;
}

Would be a none breaking feature but provide a way to do it.

๐ŸŽ‰ This issue has been resolved in version 4.0.0-dev.2 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

๐ŸŽ‰ This issue has been resolved in version 4.0.0 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€