System.Linq.Dynamic.Core icon indicating copy to clipboard operation
System.Linq.Dynamic.Core copied to clipboard

Missing ability to re-configure the ConstantExpressionHelper's sliding cache

Open alisterpineda opened this issue 1 year ago • 1 comments

Here is what to include in your request to make sure we implement a solution as quickly as possible.

1. Description

I'd like to propose a way to re-configure the sliding cache used by the ConstantExpressionHelper.

2. Exception

N/A

3. Fiddle or Project

N/A

4. Any further technical details

As it currently stands (to my understanding), the ConstantExpressionHelper is constructed once via ConstantExpressionHelperFactory.

By backtracking on ConstantExpressionHelperFactory.GetInstance() calls, it looks like the only way to configure the sliding cache is via the first usage of extended methods like Where() and others that can take in a ParsingConfig parameter.

I feel like this could be handled better where the sliding cache is configured via some static method as the class itself is virtually a singleton.

This would then make it easier for consumer applications to easily dictate a Time-To-Live setting (for example) that works best for them.

I'm happy to provide a PR if that helps.

alisterpineda avatar Oct 21 '24 19:10 alisterpineda

@alisterpineda You can try to make a PR for this, and then I can review if this fits this project.

StefH avatar May 22 '25 07:05 StefH