Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

About entity framework core integration #2

Closed
rodrigoauglima opened this issue Aug 20, 2020 · 6 comments
Closed

About entity framework core integration #2

rodrigoauglima opened this issue Aug 20, 2020 · 6 comments

Comments

@rodrigoauglima
Copy link

Sorry for opening an issue, but I have a question: about Entity Framework Core integration, keeping IQueryable without bringing all the data into memory, were you able to implement it?
Thank you for the excellent contribution.

@smokedlinq
Copy link
Collaborator

Sorry the email notification got swallowed in my inbox. Are you good or still want me to look into this?

@rodrigoauglima
Copy link
Author

Hello, I change to a manual implementation with Dynamiq Linq for now, because of my schedule. But, it will be great if you could provide some implementation EF Core 3, because the only way I managed to make work was bring all data in DbSet first and then apply oData. In any case, thanks for the help.

@smokedlinq
Copy link
Collaborator

Sure thing, added an in memory context and it does appear to only return the data that is filtered by the odata query. Give it a try, this should work for you assuming EFCore behaves the same when connected to a real data source.

@rodrigoauglima
Copy link
Author

Thanks! I've tested here with EF Core and SQL Server, and worked fine, except when we use group by clause.
I am seing this error:

Microsoft.AspNet.OData.Query.Expressions.AggregationWrapper' does not match the expected entity type 'app......entity' as set on the query context. (Parameter 'context')'

For now I wil keep using the other approadh I mentioned before with Dynamic Linq, since we already create some infrastructure to translate the querystring received to the dynamiq linq and the group by, pagination and order by are working.

But if you update this package, and need some help I will try to help. In this week maybe not because of the project schedule.
Thanks again.

@smokedlinq
Copy link
Collaborator

I dug around, this looks like a limitation on EFCore 3.1 ... doesn't look like it'll be fixed in the 5.0 release either.

dotnet/efcore#20040

@smokedlinq
Copy link
Collaborator

I was able to get group by to work but not aggregate within it.

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

No branches or pull requests

2 participants