Skip to content

Time zone settings not propagated to query #384

Open
@MrKevHunter

Description

@MrKevHunter

Using Microsoft.AspNetCore.OData V 8.0.4

in my startup I set

                .AddOData(opt =>
                {

                    opt.Select().Filter().OrderBy().Count().SetMaxTop(1000)
                        .AddRouteComponents("api", EdmModelBuilder.GetEdmModel())
                        .TimeZone = TimeZoneInfo.Utc;
                    opt.EnableAttributeRouting = true;

                })

And specify the time zone i want to use

When using

[HttpGet("api/my-endpoint")]
        [EnableQuery(PageSize = 44, MaxTop = 100, AllowedQueryOptions = AllowedQueryOptions.All)]

The ExpressionBinderHelper is not setting the TimeZone

             right = DateTimeOffsetToDateTime(right, querySettings.TimeZone, querySettings);

https://github.com/OData/AspNetCoreOData/blob/master/src/Microsoft.AspNetCore.OData/Query/Expressions/ExpressionBinderHelper.cs#L76

Has a null timezone

I've read #268 But this doesn't seem to have fixed the issue in 8.0.4

Metadata

Metadata

Assignees

Labels

FixedbugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions