-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
cast object of type 'System.DateTime' to type 'System.DateOnly' #345
Comments
Hi. How can I reproduce this? |
Code:
Table :
EFCore tries to get values by GetFieldValue method of DataReader which is overwritten, StackTrace:
|
hi again tnx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
there is an issue while using DateOnly and try to map the corresponding field in DataReader to that type.
I guess DataReader just knows DateTime:
as you see the Date column is DateTime in reader (I guess it's a behavior of ado):
I think DateOnly should be cast in DateTime then manually recreate DateOnly from that.
from the stack trace its down to this part:
exception msg: System.InvalidCastException: Unable to cast object of type 'System.DateTime' to type 'System.DateOnly'.
I'd be happy if you have a look at it, or should I pull a request?
tnx in advance.
The text was updated successfully, but these errors were encountered: