DateTime.ToLocalTime
is not supported in Linq to EF.
What's the alternative? I am running out of idea.
Instead of using .ToLocalTime() inside your Linq query, use the opposite conversion outside of the query on the parameters.
var dateUniversal = dateParam.ToUniversalTime();
var query = myTable.Where( t => t.DateTime > dateUniversal );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With