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

Checking ITruncatedCollecton.IsTruncated after enumeration. Fixes #1384 #1393

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

uffelauesen
Copy link
Contributor

This PR fixes #1384

The reading of ITruncatedCollection.IsTruncated (used by ODataResourceSetSerializer for nested resource sets) is postponed until after enumeration have completed.

This change is to support other implementations of ITruncatedCollection than the List based TruncatedCollection. Other implementations might not have the collection in memory when before enumeration starts and thus might not know if the data has been truncated like the List based one.

Some tests have been added - both my attempt to write a unittest with Mocks and an E2E test.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataResourceSetSerializer.cs: Evaluated as low risk
  • test/Microsoft.AspNetCore.OData.Tests/Formatter/Serialization/SerializationTestsHelpers.cs: Evaluated as low risk
Comments suppressed due to low confidence (1)

test/Microsoft.AspNetCore.OData.E2E.Tests/ServerSidePaging/ServerSidePagingDataModel.cs:108

  • The Dispose method is empty. If the class implements IDisposable, it should properly dispose of any unmanaged resources.
public void Dispose()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NextLinks (paging) of expanded child collections are resolved before enumeration
2 participants