-
Notifications
You must be signed in to change notification settings - Fork 57
Expand ODataSettings with additional properties to enable more configuration #83
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
Expand ODataSettings with additional properties to enable more configuration #83
Conversation
|
You'll want to pass ODataSettings to GetQueryableExpression where the We handle most of the expressions ourselves so the usage of You'll also want to add tests to account for the new logic. Make sense? |
|
Thanks for the prompt response and explanations! I'll revert the changes I did and expand Due to my lack of knowledge and overall understanding I won't change So, for now |
|
I finally had time to spend investigating behavior of both approaches mine and the one you described as preferred. First thing to clarify is a difference between To give an example, here is the arbitrary fixture: So, some Described behavior is supported by OData lib when passed through I've also tried with the approach you mentioned, through Now, I'm not sure how to proceed with this change, so any help would be appreciated! :) Thanks! |
|
I'm saying something like the following where the server configuration takes precedence over private static int? GetPageSize(TopQueryOption topQueryOption, ODataSettings oDataSettings)
{
if (oDataSettings?.PageSize.HasValue == true)
return oDataSettings?.PageSize;
return topQueryOption?.Value;
}You'd send nextLink back with the same request. You're saying that causes two a second roundtrip? |
|
The problem in using such method is that If And yes, nextLink would be sent within the response of the first request, but the params should be as described above. That means, for some client in order to get full result set, it needs to send 2 requests to fetch all 30 items. In first request 20, in second request 10. |
So this is the behavior you want - you're not saying two trips is a problem - I misunderstood. Also Please add the tests so that the expected behavior is clear - and we'll go from there. The first test should assert the expected nextLink for the second request. It still sounds to me like updating the |
25ebc1c to
b5de0b6
Compare
|
I've added few tests, 3 of them are failing due to inconsistencies we discussed. I hope this will give you needed clarity what I'm trying to achieve with these changes. It boils down to this example: |
86d3a7b to
8d6f9df
Compare
|
I've updated implementation to closely follow your recommendation, and tests are passing, so |
8d6f9df to
83d7816
Compare
|
Restoring some of the signatures. We want to match any previous callers. Didn't notice any code adding Still reviewing. |
|
Aha, code for Thanks for the support in this! |
|
If |
|
Good point, wasn't aware that's the default behavior of |
|
Looks good overall. Can you add the new tests to Thanks for the PR. This feature has been requested a few times. |
BlaiseD
left a comment
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.
- Need a double check on
int? GetPageSize(TopQueryOption topQueryOption)- what happens with$topless than pageSize. - Add corresponding tests for EF6.
82a640b to
eedc7e0
Compare
|
With this change I aim to expand custom
ODataSettingsto support additional configuration properties which are naturally exposed inODataQuerySettingstype to allow dynamic assignment of them.There is a difference in EFCore part in which
HandleNullPropagationwas set toFalsefor some reason, default value isDefault. So would be good to check that once again, although tests are passing.I was thinking to completely remove
ODataSettingsand useODataQuerySettingsbut that would be a breaking change which would be good to avoid at this moment.