-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Dynamic query on timestamptz #697
Labels
Comments
Maybe use something like: var x = dbcontext.Appointments.Where("Date == @0", DateTime.Parse("2023-03-30T00:00:00.000Z").ToUniversalTime()); |
@emaborsa |
Sorry, I have not been able to check it yet. |
@emaborsa |
Unfortunately I didnt, have to work on another project. |
I'm closing this now. In case you still have an issue, comment here or create a new issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
my Model has a DateTime property:
The DatabaseContext:
I am using dynamic Linq query, I simply use a where condition over a iQueryable:
iQueryable.Where(condition);
The
condition
is fully dynamic, I build it based on the passed parametes. If the parameter is a filter for theDate
property I don't really know how the query should be. I triedDate == "2023-03-30T00:00:00.000Z"
andDate == DateTime.Parse("2023-03-30T00:00:00.000Z")
I get:'timestamp with time zone' literal cannot be generated for Local DateTime: a UTC DateTime is required
.The database field is a
timestamptz
. I already tried adding the attribute as mentioned here, did not help.How has the condition to look like?
The text was updated successfully, but these errors were encountered: