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

group by on joined structure does not work #560

Open
stefanoyoyo opened this issue Dec 18, 2021 · 2 comments
Open

group by on joined structure does not work #560

stefanoyoyo opened this issue Dec 18, 2021 · 2 comments
Labels

Comments

@stefanoyoyo
Copy link

stefanoyoyo commented Dec 18, 2021

I wrote some code making a join (using the library) between two tables from data context exporting the result columns as object fields.
EXAMPLE:

tableA = { field1 = "", field2 = ""}
tableB = { field1 = "", field2 = ""}
var join = { tableAfield1 = "", tableAfield2 = "", tableBfield1 = "", tableBfield2 = ""}

When I try to group the obtained IQueryable collection by a selector (for example "tableBfield1"), I get the following exception:
"client-side group by is not supported".

I tried to convert the IQueryable collection to a List<Dictionary<string, object>> and I could run the group by using the library! My problem is that I can't get the data in the process but I need to keep working on the IQueryable as I need to compose a dynamic query based on a request JSON file. I need to just make my expression tree richer and richer.

Then, I tried to cast the joined collection object type to a dynamically defined type, having the same column names and types) using the method "OfType()", but it does not work.
What I mean is that I could not translate IQueryable to IQueryable using that method.

So in these days I've been wondering about the following questions:
• Is there a way to export a join IQueryable collection of a given type?
• Is there a way to cast my join collection of an anonymous object to a type?
• do i need to compose my own expression tree to make the group by work on IQueryable?

Thanks for helping guys!

@StefH StefH added the question label Dec 18, 2021
@StefH
Copy link
Collaborator

StefH commented Dec 18, 2021

Hello @stefanoyoyo,

Can you please provide a full working example which describes this issue?

1 similar comment
@StefH
Copy link
Collaborator

StefH commented Feb 22, 2023

Hello @stefanoyoyo,

Can you please provide a full working example which describes this issue?

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