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

Allow translating non-constant NewExpression in translators and plugins #18797

Open
roji opened this issue Nov 7, 2019 · 0 comments
Open

Allow translating non-constant NewExpression in translators and plugins #18797

roji opened this issue Nov 7, 2019 · 0 comments

Comments

@roji
Copy link
Member

roji commented Nov 7, 2019

We currently can't translate the following NodaTime expression:

var d = ctx.NodaTimeTypes.Single(t => t.LocalDate < new LocalDate(t.LocalDate.Year, 4, 21));

... since the constructor contains a non-evaluatable parameter. Ideally it should be possible to translate via a translator (like method or member), and exposed to plugins as well.

Low priority, at the moment am only aware of NodaTime types - but there may be others. Raised in npgsql/efcore.pg#1020.

Note that for DateTime this can be done in the SQL translating visitor, as it isn't a plugin.

@roji roji changed the title Allow translating non-constant NewExpression in translators plugins Allow translating non-constant NewExpression in translators and plugins Nov 7, 2019
@ajcvickers ajcvickers added this to the Backlog milestone Nov 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants