Skip to content

Expose the value of odata.maxpagesize on ODataQueryOptions#2155

Open
stephenjust wants to merge 377 commits into
OData:masterfrom
stephenjust:expose-maxpagesize-preference
Open

Expose the value of odata.maxpagesize on ODataQueryOptions#2155
stephenjust wants to merge 377 commits into
OData:masterfrom
stephenjust:expose-maxpagesize-preference

Conversation

@stephenjust

Copy link
Copy Markdown

Description

This change exposes the value of the Prefer: odata.maxpagesize=N header so that controllers can more easily build logic to handle it if a custom paging solution is used.

Checklist (Uncheck if it is not completed)

  • Test cases added (Covered by existing PageAttributeTest)
  • Build and test with one-click build and test script passed

Additional work necessary

If documentation update is needed, please add "Docs Needed" label to the issue and provide details about the required document change in the issue.

Public interface change, new property would need to be documented.

xuzhg and others added 30 commits March 23, 2018 15:32
…rate is:

AspNet    : 4648 pass, 0 fail - 100% enabled, 100% pass
AspNetCore: 4123 pass, 97 fail - 91% enabled, 89% pass

This change:

1.) ModifiesEnableQuery to return a Json format similar to the HttpError format in AspNet. Many tests are expecting
    the exact json format from AspNet classic. It's a fine format not specific to any platform so I chose to
    emulate is for AspNetCore.

2.) Implements async client query pattern as the NetStandard version of the client does not support sync methods.

3.) Modifies LowerCamelCase tests to match error profile of AspNetCore for model validation failures.
to avoid having AspNetCore validate the object, which may access properties
such as SelectClause which throw if the clause is invalid.
…riPartial.Path)

to return the path port of the Uri, which escapes characters that need it.
The ODL Parser expects those characters to be escaped.

Uri.GetLeftPart(UriPartial.Path) is used in the AspNet version in this scenario as well.
…rate is:

AspNet    : 4648 pass, 0 fail - 100% enabled, 100% pass
AspNetCore: 4155 pass, 65 fail - 91% enabled, 98% pass

This change:

1.) Wrap EnableQueryAttribute and IActionFilter in a QueryFilterProvider() in the test fixture.
    This is similar to the configuration used in the product configuration extensions.

2.) Modifies the case of Json properties in TopSkipOrderByTests.cs.

3.) Implements async client query pattern in SingletonClientTest.cs.

4.) Implements CreateODataPath().
the description and the QueryFilter itself.
the EntityId. The response code is not set properly until after
ExecuteResultAsync() is completed.
key is not present in the SerializableError.

Convert the errors in SerializableError into ODataErrorDetail
collection.
…bound

is either ODataQueryOptions or ODataQueryOptions<T>.
if a filter of the same type is already present in the Filters list.

Modify QueryFilterProvider to apply of a global query filter
if the return type is a Task<> returning a collection and if the
return type is derived from single result.
…ataPathRouteConstraintTest.

RFC3986 specifies "[" and "]" and gen-delims in BNF notation in section 2.2 but section 3.2.2
specifies that the are only valid in a Uri as part of an IPV6 host. Therefore, they are not
valid in any part of a Uri, which is how the tests use _stringsLegalEverywhere.
…rate is:

AspNet    : 4648 pass, 0 fail - 100% enabled, 100% pass
AspNetCore: 4424 pass, 0 fail - 95% enabled, 100% pass

This change:

1.) Fixes DelayLoadFilterProvider so it works.
2.) Adds coreBuilder.AddDataAnnotations() to enable DataAnnotation validation.
3.) Makes the default action "Get"
4.) Makes Created() and BadRequest() return action results.
5.) Includes route name in GetServiceRootUri()
6.) Fixes LowerCamelCaseTest to expect BadResult() now that ODataQueryOptions skips parameter validation.
7.) Disables CRUDEntitySetShouldWork() since unicode values in headers are not supported in Kestrel.
8.) Modifies IsofFunctionTests to expect an HttpRequestException since an error occurs during formatting
    after headers has been sent and AspNetCore returns HttpRequestException in this case.
9.) Modifies ODataValueProviderTests to inject an Id instead of an object due to AspNetCore parameter
    handle; this also work in AspNet.
10.) Fixes tests in DeltaOfTValidationTests, ComplextTypeCollectionTests, JsonSingleResultExpandTests,
     ODataQueryOptionsTests, QueryFuzzingTests, ValidatorTests, and DeltaOfTValidationTests
11.) Enables tests in ContainmentTests, DeltaTests, SecurityTests, PropertyTestsUsingConventionModelBuilder,
     CustomFilterValidator, AddRelatedObjectTests, SingletonTests
mikepizzo and others added 27 commits February 10, 2020 21:20
1) Fix batch dispose issue (error writing to a closed stream)
2) Fix async batch issues (synchronous write to an asynchronous reader error)
-Case-insensitive header comparison
-Default to JSON Batch response if request is JSON
-Make sure stream is released before reading next request within a batch
-Added/fixed tests for standard and .net core
…hronous writing behavior to avoid possible (though unlikely) breaking change.

Note that any types directly deriving from ODataBatchResponseItem would have to be recompiled due to changes in abstract base class (abstract method now takes a writeAsync parameter).  Seems highly unlikely that other custom types are deriving directly from ODataBatchResponseItem.
In .NET 5, we should clean up the overloads that write to the stream synchronously, and probably make most of this internal (no reason to make the WriteResponseAsync/WriteMessageAsync on ODataBatchResponseItem public).
* Added support for functions and constants in aggregate expression

* Tests for more cannonical functions

* Time tests

* Support for compute transformation in $apply

* Support sorting for columns introduced in compute

* Remove redundant code

* Fix flakyness in AggregateNavigationPropertyWorks

* Fix the ToInt16 overflow during build

* Fix typos

* Make _values field private

* Explicit way to mutate element type and lambda param

* Test to demonstrate that we could run compute on complex entity properties

* Support for complex types

* Simplify keepoing ElementType and LambdaParameter in sync

Co-authored-by: Sam Xu <saxu@microsoft.com>
… dynamic controller (OData#2035)

* Enable endpoint routing using dynamic controller

* Update to 7.4.0

* Update the PublicAPI test cases

* Add the E2E test cases

* Change the startup to test the per-route configuration

* Some test codes about policy

* Use MatcherPolicy Instead of EndpointSelector to resolve the ambiguity

* Address the comments and add LinkGenerator test cases

* Revert the EF Core version to 2.2.0 to make Aggregation E2E test pass
* Add test to verify batch handler does not copy all headers to individual requests

* Control which headers are copied from batch to individual requests

* Handle quoted and escaped preference header values in batch requests

* Fix regression in default batch handler tests

* Minor refactor of header handling in batch handler

* Use only comma as separator for preferences in Prefer header

* Handle multiple prefer headers and duplicate preferences in batch request

* Minor style fixes

* Refactor handling of batch headers

* Remove unnecessary Trim() in preference header handling

* Remove space from preference header separator
* Everything except properties.

Fix tests

Address PR comments

Remove Inline change due to a bug

* Address PR comments and take sam's input

parity between actions and functions

self review

Update tests

fix final set of issues

* Address PR comments

address pr comments

update method
@xuzhg xuzhg force-pushed the master branch 2 times, most recently from 4c43a84 to ddfd3dd Compare May 29, 2026 01:09
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.