System.Linq.Dynamic.Core
System.Linq.Dynamic.Core copied to clipboard
Is there a way to apply Parsing config to all Where statements?
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?
This is not yet possible.