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

Is there a way to apply Parsing config to all Where statements?

Open lvyyljn opened this issue 1 year ago • 1 comments

I am currently working on building filter extension that requires going through a filter class and based on type of a property select different Where filter

Basically it looks like this:

switch (propertyValue)
{
          case DomainValueRange valueRange:
                 {
                      if (valueRange.From != null)
                      {
                         query = query.Where(_parsingConfig, ValueRange.FromPredicate(propertyName), Range.From);
                      }
                          
                      if (valueRange.To != null)
                      {
                         query = query.Where(ValueRange.ToPredicate(propertyName), valueRange.To);
                      }

                         break;
                  }
}

As a result I get:
[o0].[Field1] >= @__Value_0 AND [o0].[Field2] <= '2020-12-30'

Is there a way to override default config for all Where's at once instead of passing them each time?

lvyyljn avatar Aug 09 '24 14:08 lvyyljn

This is not yet possible.

StefH avatar Aug 15 '24 10:08 StefH