Skip to content

Question: Generic and Param based Custom Type Methods Support #386

@joshidp

Description

@joshidp

Hello,

Thanks for the awesome work.

I'm using your lib to write json configurable rules. I want to used generic and param based custom type methods as Utility methods. Below is a sample json config snippet.

{"expression": "Utilities.ConvertToArray(\"xyz\",\"abc\")"}

and below is the method with param

 public static string[] ConvertToArray(params string[] values)
        {
            if (values == null)
            {
                return new string[0];
            }

            return values.ToArray();
        }

When I try to call DynamicExpressionParser.ParseLambda method with above expression it fails with an error saying "No method called ConvertToArray found in Utilities". Please not normal method without param works just fine.

I want to create an array but since that was not possible in the expression directly using your lib I tried using the Utility method.

Similarly, generic methods also doesn't work.

Please help in providing a solution.

Thanks

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions