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
Because I do not know how to use linq query,so i can only use sql query,
This is code
var sql = $"SELECT * FROM base_authenticateLogs WHERE recordtime <= NOW() AND username = '{userName}' AND (reservedfield ->> 'setup') = 'Setup1' ORDER BY id DESC LIMIT {limit}";
var entitys = this.DbContext.Set<AuthenticateLogEntity>().FromSql(sql);
and the 'recordtime' type is DateTimeOffset ,and my time zone is '+08:00'.
in database, i execute this sql ,the value is
The result is right!
but in code, the value is
The time zone is '+00:00'??????
so,where is wrong?
can you help me to solve it?
//-----------------------------------------------------------
Extra information:
It would help if you posted the actual table schema you're querying (with column types).
However, looking at your SQL, I'm seeing reservedfield ->> 'setup'. At the moment, the Npgsql EF Core provider doesn't provide any way to generate this JSON operation from a LINQ query - this feature is tracked by #4. So regardless of any issue with DateTimeOffset, you're going to have to continue using raw SQL until #4 is done.
Let me know if you have any further questions/issues.
Because I do not know how to use linq query,so i can only use sql query,
This is code
and the 'recordtime' type is DateTimeOffset ,and my time zone is '+08:00'.
in database, i execute this sql ,the value is
![c1qkrn42 9tk a 3y 2 86](https://user-images.githubusercontent.com/8411781/29001311-ed60464a-7ab8-11e7-8679-902ef5a817f8.png)
The result is right!
but in code, the value is
![image](https://user-images.githubusercontent.com/8411781/29001316-41e4f580-7ab9-11e7-9361-c1e270d8d060.png)
The time zone is '+00:00'??????
so,where is wrong?
can you help me to solve it?
//-----------------------------------------------------------
Extra information:
on OnModelCreating:
on Entity:
The text was updated successfully, but these errors were encountered: