Skip to content

Migration does not handle datetimeoffset #45

@krmr

Description

@krmr

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions