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

Filtering or sorting when I used join in query #88

Open
Patryxus opened this issue Jun 27, 2020 · 1 comment
Open

Filtering or sorting when I used join in query #88

Patryxus opened this issue Jun 27, 2020 · 1 comment

Comments

@Patryxus
Copy link

Hi!
I cannot find how can I define filters and sorts when some of them are from entity A, some of them from Entity B? I have more complex queries with joins, left joins (I thinks most of us use more sophisticated queries in reality). Is there any possibility to use your library for that?
I add that sometimes there is no navigation properties.
Another issue is: can I somehow change filters or sorts from the SieveModel (remove some, add another one) ? If I only can modify a list of FilterTerm and used such changed SieveModel but I cannot see how to create SieveModel based on list of FilterTerm or SortTerm.
It would be great if I can check which entity has a given property (GetFiltersParsed and use some your methids) and then divide it into groups and apply step by step. Unfortunately now I get en error when property isn't defined in entity ;(.
I regret that in methods ISieveCustomFilterMethods I don't have as parametr the filter object FilterTerm, because now I have to manually check op, values and create my own FilterTerm again (you can methods based on FilterTerm).
Any clues?
Thanks in advanced.

@stefankip
Copy link

stefankip commented Oct 14, 2020

I have the same sort of issue, for example this is the model:

{
  "ID": 12345,
  "SomeProperty": "SomeValue",
  "AnArrayOfValues": [
    {
      "Key": "2020",
      "Amount": 1234
    },
    {
      "Key": "2021",
      "Amount": 12345
    },
    {
      "Key": "2020Q1",
      "Amount": 123
    },
    {
      "Key": "2020Q2",
      "Amount": 111
    },
    {
      "Key": "2020M1",
      "Amount": 12
    },
    {
      "Key": "2020M2",
      "Amount": 12
    }
  ]
}

I want to sort on the Key and Amount properties of the AnArrayOfValues property, for example order by the Amount belonging to the Key 2020

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

No branches or pull requests

2 participants