Repository navigation
Added Convert.ToDateTime as a supported method for translation #1297 - #1298
TanielianVB wants to merge 5 commits into
Conversation
|
Maybe it would have been best if I didn't created a pull request so soon. I could have asked the same referencing the commit on my fork without creating a pull request. |
|
@TanielianVB no worries about creating a PR! Yeah, it actually is that simple (though a test would also be good). The reason this hasn't been done is that unlike Convert.ToInt32, Convert.ToDateTime would not work on the database in the same way as it would work in C#: the date format strings accepted by PostgreSQL and by .NET ToDateTime are very different. Let's wait for some feedback in #1297 before doing anything. |
|
I think that if a dev uses Convert.ToDateTime he has to know in what SQL the query will be translated. But, we can also add functions like EF.Functions.ILike to the TO_DATE and TO_TIMESTAMP functions. |
|
The general principle in EF is for methods to behave in the same way when translated to the server, as they would when executed on the client - this is why Convert.ToDateTime is somewhat problematic... But you're right that in any case we can provide something on EF.Functions. |
roji
left a comment
There was a problem hiding this comment.
Sorry for taking so long to review this.
Can you please add a test to NorthwindFunctionsQueryNpgsqlTest which follows the model of the tests in EF Core?
|
Already made all requested changes. |
79fae3a to
f894de9
Compare
75c2ea9 to
d038259
Compare
It could not be so simple as that right? But I could not find the unit tests that asserted the translated query from the other Convert methods so... How could I test it?
Sorry in advance if I took an unnecessary step.