question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested property methods not found when inheriting from List<T>

See original GitHub issue

This is strange but I noticed that calling nested properties work, but not nested methods.

// this works in the json rule
"expression": "input1.PropertyClass.MyProperty"

//this doesn't
"expression": "input1.PropertyClass.MyMethod('some string')"

This is the exception when trying to invoke nested methods:

“Exception while parsing expression input1.PropertyClass.MyMethod("hello") - No applicable aggregate method ‘MyMethod(String)’ exists”

How can I invoke nested methods from an expression?

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
abbasc52commented, Dec 21, 2022

@abbasc52 , we’re happy to do some investigation to see if it’s possible to support this scenario. Any chance you can give us some pointers as to where to start in the code?

Hi @everettcomstock, this seems to be an issue with dynamic.linq.core library which is primarily used for expression parsing. I had dug deep into their implementation, and it seems they handle IEnumerable related classes separately.

I still need to go through the example to see if there is any workaround and if there is a scope to support it. Although this is a corner case, I will let you know if there is an opportunity to support it.

1reaction
duyn9uyencommented, Dec 15, 2022

I was hoping that someone can at least confirm whether this should work or not. I can’t find a similar example of this. I only see root properties and methods being called by RE in your documentation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript Object.create -- inheriting nested properties
create to create a new object - say 'anotherPerson' - which inherits the methods and properties from the initial 'person' object. If I...
Read more >
Cascade, specificity, and inheritance - Learn web development
Though every CSS property page lists whether or not the property is inherited, you can often guess the same intuitively if you know...
Read more >
Inheritance - Learning the Java Language
A subclass inherits all the members (fields, methods, and nested classes) from its superclass. Constructors are not members, so they are not inherited...
Read more >
Type.GetNestedTypes Method (System)
This method returns only the nested types of the current type. It does not search the base classes of the current type. To...
Read more >
Inheritance in C# and .NET
Private members are visible only in derived classes that are nested in their base class. Otherwise, they are not visible in derived classes....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found