Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lvyyljn opened this issue Aug 9, 2024 · 1 comment
Open

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

lvyyljn opened this issue Aug 9, 2024 · 1 comment
Assignees
Labels

Comments

@lvyyljn
Copy link

lvyyljn commented Aug 9, 2024

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?

@StefH StefH self-assigned this Aug 15, 2024
@StefH StefH added the question label Aug 15, 2024
@StefH
Copy link
Collaborator

StefH commented Aug 15, 2024

This is not yet possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants