Support for filtering with DateTimeOffset and Oracle "TIMESTAMP(6) WITH LOCAL TIME ZONE"
Posted: Fri 12 Oct 2018 03:54
I have an aspnetcore API with an entity that maps Oracle "TIMESTAMP(6) WITH LOCAL TIME ZONE" columns to DateTimeOffset. Storage and retrieval seem to work fine. But when I try to build a linq expression to filter on those columns, I get the following error.
Any ideas? This is using Devart.Data.Oracle.Linq v4.8.1566
Code: Select all
[Table(Name = "ORDER")]
public class OrderEntity
{
[Column(Name = "CREATED", DbType = "TIMESTAMP(6) WITH LOCAL TIME ZONE NOT NULL")]
public DateTimeOffset Created { get; set; }
}
Code: Select all
var result = _dataContext.Orders.Where(r => r.Created >= DateTimeOffset.Now.AddDays(-1)).ToList();
Code: Select all
System.NotSupportedException: 'Cannot use "TIMESTAMP(6) WITH LOCAL TIME ZONE" type value in "DateTimeOffset" type argument'
at Devart.Data.Linq.Engine.DbMethodCallConverter.CheckConversionToParameterType(SqlExpression argumentValue, Type parameterType)