Enable $this in query options
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
In OData spec, the $this literal can be used in $filter and $orderby expressions nested within $expand and $select for collection-valued properties and navigation properties. It refers to the current instance of the collection. OData Version 4.01. Part 2: URL Conventions (oasis-open.org)
Examples
// select only email addresses ending with .com
http://host/service/Customers?$select=EmailAddresses($filter=endswith($this,'.com'))
// Select and orderby EmailAddresses.
// EmailAddresses is a collection of primitive types
http://host/service/Customers?$select=EmailAddresses($orderby=$this)
There's some tests skipped owning $this. see at:
https://github.com/OData/AspNetCoreOData/blob/master/test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/SelectExpandBinderTest.cs#L513
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the skipped tests in test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/SelectExpandBinderTest.cs around line 513, and compare them with the OData 4.01 behavior described in the issue. Trace the select/expand query binding entry point used by those tests. Done means the relevant $filter and $orderby cases using $this are enabled and pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100