-
Notifications
You must be signed in to change notification settings - Fork 225
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
Convert.ToDateTime not working #1297
Comments
This is about expressing conversion from text to DateTime. We generally support Convert.ToInt32, ToDouble because those conversions are straightforward and unambiguous, whereas string->DateTime conversion depends on formatting (which will be different between .NET and the DB). However, it may make sense to provide such a translation, making it clear that it will happen in whatever way the database chooses to do it. /cc @ajcvickers @smitpatel has there been a conversation about this, is there a tracking issue? |
So? I can start working on a PR as soon as a decision is taken. |
@ajcvickers @smitpatel I'm not sure anymore... have we decided anything on this? |
@roji I think we said that we would generate simple casts in the database, but would not try to be specific about how the conversions worked. However, I'm not sure either. |
We had discussions about translating ToString method on object which would be whatever string representation of the value in database is. |
After discussion with the EF Core team, we think it's a good idea to add this. This would ideally first be submitted for the SQL Server provider (this is the relevant translator, and then submitted here for PostgreSQL (the files are virtually identical). |
Nice! Thanks for the reply. |
Is there any updates on this?
|
Hi,
With the following table:
The following sample:
I'm getting this error:
I was expecting this kind of query translated:
The values stored on the table in my case are something like this when they are DateTimes: "2020-01-21T14:33:29-03:00"
I searched for some cast method like the EF.Functions.ILike method but had no luck.
Thanks in advance,
The text was updated successfully, but these errors were encountered: