Skip to content

Set the time zone in ODataQuerySettings from the request context#1403

Open
icnocop wants to merge 3 commits intoOData:mainfrom
icnocop:main
Open

Set the time zone in ODataQuerySettings from the request context#1403
icnocop wants to merge 3 commits intoOData:mainfrom
icnocop:main

Conversation

@icnocop
Copy link

@icnocop icnocop commented Feb 1, 2025

Fixes #384

@WanjohiSammy
Copy link
Member

Please add an End-to-End test with this scenario:
https://github.com/OData/AspNetCoreOData/tree/main/test/Microsoft.AspNetCore.OData.E2E.Tests

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

returnSettings.CopyFrom(settings);
}

returnSettings.TimeZone ??= context.Request.GetTimeZoneInfo();
Copy link
Member

Choose a reason for hiding this comment

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

Would you like to place this line of code before the copyFrom during the initialization of returnSettings?

The change you've suggested will always override the copyFrom action. Please note that null is a valid value, and users might choose to set returnSettings.TimeZone to null.

@mguinness
Copy link

Has this been addressed in #1546?

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.

Time zone settings not propagated to query

4 participants