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

Migration does not handle datetimeoffset #45

Open
krmr opened this issue Sep 9, 2020 · 0 comments
Open

Migration does not handle datetimeoffset #45

krmr opened this issue Sep 9, 2020 · 0 comments

Comments

@krmr
Copy link

krmr commented Sep 9, 2020

The current code unfortunately does not translate filter expressions with datetimeoffset eg. $filter=Date ge datetimeoffset'2020-09-09T00:00:00Z'. If sending this it is passed forward as a literal string and fails in the v4 endpoint as datetimeoffset is unknown.

The problem can be fixed by extending QueryNodeTranslator.Visit(Data.OData.Query.SemanticAst.ConstantNode nodeIn) for example like this:
{ v => v is DateTimeOffset, v => ((DateTimeOffset)nodeIn.Value).UtcDateTime.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ssK", CultureInfo.InvariantCulture)

Since a number of classes for the tranlsations are internal it is not straightforward to use the package but override some methods.

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

No branches or pull requests

1 participant