You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get some query working which includes binding value multiple times:
eg.
.OrderByRaw("CASE WHEN StartDate < ? and (EndDate is null or EndDate > ?) THEN 0 WHEN StartDate > ? THEN 1 ELSE 2 END",
bindings:newobject[]{ DateTime.Today, DateTime.Today, DateTime.Today })
Is there any way to modify query in a way, so the DateTime.Today declared only ones.
Doc says nothing about that.
The text was updated successfully, but these errors were encountered:
varquery=new Query("Users").Define("Today", DateTime.Today).OrderByRaw("CASE WHEN StartDate < ? and (EndDate is null or EndDate > ?) THEN 0 WHEN StartDate > ? THEN 1 ELSE 2 END",
bindings:newobject[]{ Variable("Today"), Variable("Today"), Variable("Today")})
It doesn't make sense to me.
Would be nice to have named parameters, so I can use them in raw queries like this:
varquery=new Query("Users").Define("Today", DateTime.Today).WhereRaw("DATEPART('weekday', @Today) = 3").OrderByRaw("CASE WHEN StartDate < @Today and (EndDate is null or EndDate > @Today) THEN 0 WHEN StartDate > @Today THEN 1 ELSE 2 END")
I am trying to get some query working which includes binding value multiple times:
eg.
Is there any way to modify query in a way, so the
DateTime.Today
declared only ones.Doc says nothing about that.
The text was updated successfully, but these errors were encountered: