-
Notifications
You must be signed in to change notification settings - Fork 352
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
Support for OData $count operations as per v4.01 spec section 11.2.10 #1298
Conversation
@joshcomley Would you please file two issues:
|
@joshcomley I see there are some build errors:
Would you please help take a look? |
Assert.Equal(new Uri("http://gobbledygook/People?$expand=MyPaintings%2F%24count"), actualUri); | ||
} | ||
|
||
// This is not supported, yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to support parameter alias. :)
} | ||
|
||
public ExpandedCountSelectItem(ODataExpandPath pathToNavigationProperty, IEdmNavigationSource navigationSource) : base(pathToNavigationProperty, navigationSource) { } | ||
public ExpandedCountSelectItem(ODataExpandPath pathToNavigationProperty, IEdmNavigationSource navigationSource, FilterClause filterOption, OrderByClause orderByOption, long? topOption, long? skipOption, bool? countOption, SearchClause searchOption) : base(pathToNavigationProperty, navigationSource, filterOption, orderByOption, topOption, skipOption, countOption, searchOption) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joshcomley The spec says " The $count segment can be appended to a navigation property name or type-cast segment following a navigation property name to return just the count of the related entities. The $filter and $search system query options can be used to limit the number or related entities included in the count. ",
So, it seems it only accepts "filterOption" and "SearchOption" in "ExpandedCountSelectItem" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@xuzhg It should only accept filter and search, yes
f9519fd
to
14a4b12
Compare
I've just realised this issue is still outstanding (have been using my own patched version of OData for a while). What do I need to do to get this merged? |
@joshcomley Thanks for tracking on this. I have fixed some failure test cases and recreate a PR at: #1336. We do like this feature to be implemented. However, for your changes, i'd like to change some design and implementation. Owing to other high priority task, this change is postpone. It seems you are interested it again, maybe we can find some time to sync it. |
Hi @xuzhg, thanks for getting back to me. As it's been a year since these changes, some things have changed, but I have re-applied my changes to the latest version of the code-base. Should I delete this PR and create a new one with the new amendments? |
* fix OData#2003 * fix OData#2003 * fix OData#2003 * fix OData#2003 Co-authored-by: Maxim Voronov <[email protected]>
…Data#2002) * Extend TextWriterWrapper abstract class with equivalent async methods and provide the implementation in the derived NonIndentedTextWriter class Co-authored-by: John Gathogo <[email protected]>
# Conflicts: # src/Microsoft.OData.Core/JsonLight/ODataJsonLightWriter.cs
This PR has today been rebased on master, the changes added in #1336 have been merged in and I have added support for |
@joshcomley |
Issues
I am unable to find an open issue relating to this.
Description
As per the title, this is to implement support for $count operations such as:
With this change, the following is still unsupported:
Specification reference:
http://docs.oasis-open.org/odata/odata/v4.01/cs01/part1-protocol/odata-v4.01-cs01-part1-protocol.html#sec_RequestingtheNumberofItemsinaCollect
Checklist (Uncheck if it is not completed)
Additional work necessary
Functional tests need to be written.
Unsure if docs need to be updated.