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

Please make interface ICountOptionCollection public #1382

Open
uffelauesen opened this issue Jan 6, 2025 · 0 comments · May be fixed by #1383
Open

Please make interface ICountOptionCollection public #1382

uffelauesen opened this issue Jan 6, 2025 · 0 comments · May be fixed by #1383
Labels
bug Something isn't working

Comments

@uffelauesen
Copy link
Contributor

Assemblies affected
ASP.NET Core OData 8.x

Describe the bug
Currently I have to override the default ODataResourceSetSerializer to get $count=true (inline count) of expanded child collections to work as expected. The standard ODataResourceSetSerializer uses the ICountOptionCollection (that has one simple property defined TotalCount) to get total count of an expanded collection. The interface is internal and only implemented by TruncatedCollection. My OData service does not have any CLR backing types nor do I have any in memory Lists or Collections of objects - in other words: I do not use TruncatedCollection but have my own non in-memory based implementation where I wan't to implement the ICountOptionCollection interface to get the standard ODataResourceSetSerializer to work for expanded child counts.

Reproduce steps
Try to implement ICountOptionCollection

Data Model
NA

EDM (CSDL) Model
NA

Request/Response
NA

Expected behavior
I can implement ICountOptionCollection.

Screenshots
NA

Additional context
Currently I am forced to override the standard ODataResourceSetSerializer to get this to work. It is quite alot of code I need to replicate. Recently alot of changes were done to the standard serializers due some changes to Delta sets. This requires porting to my custom serializer. It would be nice to be able to avoid that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant