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

FEATURE REQUEST: Provide advanced OrderBy of compound Predicate #184

Open
EchoFoxxtrot opened this issue Feb 16, 2023 · 1 comment
Open

Comments

@EchoFoxxtrot
Copy link

I have a TableA that has a one to many relationship with TableB, which is a 1:1 join table with TableC and I am able to successfully create filter queries using a Predicate in breeze-client like the following:

(value: any) => {
   return new Predicate('navOfTableB', 'any', 'fieldTableC.targetField', FilterQueryOp. Equals, value);
}

Since I'm creating filter critera for columns in a JavaScript grid like AG-Grid, it would be really, really nice to be able to have some mechanism by which I could specify an OrderBy for a field off of an Any/Some relationship. The best I can find in the documentation is filtering on a 1:1 child table's field like

orderBy: 'fieldTableC.targetField'

which is one level to removed from what I need since I'm reading from a join table to a collection of objects. What I need is the ability to order results for TableA from the any/some relationship of TableB and its child table's field TableC.TargetField like:

orderBy: 'navOfTableB.fieldTableC.targetField'  

Breeze-client allows a server call is made using the latter statement that tries to read the field from the IEnumerable and, of course, that attempt fails because it's trying to read the field on the IEnumerable collection and not from the objects themselves.

In SQL Server land, you would simply have table aliases A, B, and C and you could just

ORDER BY C.TargetField, 
A.SomeOtherField 

but is it possible to create such a sort using the existing orderBy syntax for breeze-client so that it is understood by Breeze Server .NET, or if not, could something be devised that could?

@steveschmitt
Copy link
Member

@jtraband Any ideas about this one?

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