Add IQueryable support as GetList overload with LINQ-to-OData translation#65
Draft
Add IQueryable support as GetList overload with LINQ-to-OData translation#65
Conversation
…ata translation Co-authored-by: dnaumov <150417680+dnaumov@users.noreply.github.com>
Co-authored-by: dnaumov <150417680+dnaumov@users.noreply.github.com>
Co-authored-by: dnaumov <150417680+dnaumov@users.noreply.github.com>
…caping Co-authored-by: dnaumov <150417680+dnaumov@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add IQueryable support to GetList and GetListAsync methods
Add IQueryable support with LINQ-to-OData translation for GetList/GetListAsync
Oct 31, 2025
Contributor
|
@copilot Can you make it an overload to getList instead of a separate method? |
Co-authored-by: dnaumov <150417680+dnaumov@users.noreply.github.com>
Contributor
Author
Done! Changed from // Returns IQueryable for LINQ support
var customers = client.GetList<Customer>(asQueryable: true)
.Where(c => c.Status.Value == "Active")
.ToList();All tests updated and passing. Commit: 32f24f4 |
Copilot
AI
changed the title
Add IQueryable support with LINQ-to-OData translation for GetList/GetListAsync
Add IQueryable support as GetList overload with LINQ-to-OData translation
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables LINQ Where clauses to automatically translate to OData $filter parameters, eliminating manual filter string construction and providing type-safe queries. Implemented as an overload of the existing
GetList()method.Implementation
Core Components
EntityQueryProvider- IQueryProvider that intercepts LINQ expressions and invokes GetListAsync with translated OData parametersEntityQueryable<T>- IQueryable wrapper with async execution methods (ToListAsync, FirstAsync, CountAsync, etc.)ExpressionToQueryParametersVisitor- Expression tree visitor that translates LINQ to OData:==,!=,>,>=,<,<=→eq,ne,gt,ge,lt,le&&,||,!→and,or,notContains(),StartsWith(),EndsWith()→ OData functionsTake(),Skip()→$top,$skipGetList<T>(asQueryable: true)overload on ApiClient that returnsIQueryable<EntityType>Key Details
DataMemberattributes for proper JSON property name serialization (e.g.,Date.Value→Date/value)andUsage
Testing
14 new tests covering filter generation, pagination, async execution, filter combination, and URL encoding. All existing tests pass.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.