System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
-
- Posts: 9
- Joined: Tue 21 Aug 2018 13:56
System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
Hi!
We are using Devart.Data.PostgreSql.EFCore 7.12.1328 and PostgreSQL version:
"PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit".
I reproduced my scenario to share with you (https://drive.google.com/open?id=1plGUX ... Q0Q1FE6kxL).
I have a complex query, with a complex model data (including DateTimeOffset fields), where I use the let operator with some aggregation operations.
When I try to execute a query I get this exception as a result:
System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'.
at . (Object , Int32 )
at .(Object , ? , Int32 )
at . ( )
at .(Expression )
at .(BinaryExpression )
at .VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at .(String , Expression , Expression )
at .(BinaryExpression )
at .VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.VisitConditional(ConditionalExpression conditionalExpression)
at System.Linq.Expressions.ConditionalExpression.Accept(ExpressionVisitor visitor)
...
Thank you for reading.
We are using Devart.Data.PostgreSql.EFCore 7.12.1328 and PostgreSQL version:
"PostgreSQL 11.2 (Debian 11.2-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516, 64-bit".
I reproduced my scenario to share with you (https://drive.google.com/open?id=1plGUX ... Q0Q1FE6kxL).
I have a complex query, with a complex model data (including DateTimeOffset fields), where I use the let operator with some aggregation operations.
When I try to execute a query I get this exception as a result:
System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'.
at . (Object , Int32 )
at .(Object , ? , Int32 )
at . ( )
at .(Expression )
at .(BinaryExpression )
at .VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at .(String , Expression , Expression )
at .(BinaryExpression )
at .VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at Microsoft.EntityFrameworkCore.Query.Sql.DefaultQuerySqlGenerator.VisitConditional(ConditionalExpression conditionalExpression)
at System.Linq.Expressions.ConditionalExpression.Accept(ExpressionVisitor visitor)
...
Thank you for reading.
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
Thank you for your report. We have reproduced the issue and are investigating it. We will notify you about the result.
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
The translation of DateTimeOffset literal into SQL statement is supported: viewtopic.php?f=3&t=38516.
-
- Posts: 9
- Joined: Tue 21 Aug 2018 13:56
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
Hi!
Running in Debug mode it's works, but when I publish the code:
Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred while iterating over the results of a query for context type 'Devart.PostgreSql.SchedulerContext'.
System.ArgumentNullException: Value cannot be null.
Parameter name: queryCompilationContext
at Microsoft.EntityFrameworkCore.Utilities.Check.NotNull[T](T value, String parameterName)
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression..ctor(SelectExpressionDependencies dependencies, RelationalQueryCompilationContext queryCompilationContext)
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression.Clone(String alias)
at ? . ? ? (SelectExpression )
at ? . ? ? (SelectExpression )
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
at ? .VisitUnary(UnaryExpression )
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at ? .VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at ? . ? ? (Ordering )
at ? . ? ? (SelectExpression )
at ? . ? ? (SelectExpression )
at System.Linq.Expressions.ExpressionVisitor.VisitAndConvert[T](T node, String callerName)
at .CreateDefault(SelectExpression )
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.<NotifyReaderCreated>b__14_0(FactoryAndReader s)
at Microsoft.EntityFrameworkCore.Internal.NonCapturingLazyInitializer.EnsureInitialized[TParam,TValue](TValue& target, TParam param, Func`2 valueFactory)
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.NotifyReaderCreated(DbDataReader dataReader)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.AsyncSelectEnumerable`2.AsyncSelectEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
System.ArgumentNullException: Value cannot be null.
Parameter name: queryCompilationContext
at Microsoft.EntityFrameworkCore.Utilities.Check.NotNull[T](T value, String parameterName)
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression..ctor(SelectExpressionDependencies dependencies, RelationalQueryCompilationContext queryCompilationContext)
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression.Clone(String alias)
at ? . ? ? (SelectExpression )
at ? . ? ? (SelectExpression )
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
at ? .VisitUnary(UnaryExpression )
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at ? .VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at ? . ? ? (Ordering )
at ? . ? ? (SelectExpression )
at ? . ? ? (SelectExpression )
at System.Linq.Expressions.ExpressionVisitor.VisitAndConvert[T](T node, String callerName)
at .CreateDefault(SelectExpression )
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.<NotifyReaderCreated>b__14_0(FactoryAndReader s)
at Microsoft.EntityFrameworkCore.Internal.NonCapturingLazyInitializer.EnsureInitialized[TParam,TValue](TValue& target, TParam param, Func`2 valueFactory)
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.NotifyReaderCreated(DbDataReader dataReader)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.AsyncSelectEnumerable`2.AsyncSelectEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
Value cannot be null.
Parameter name: queryCompilationContext
Running in Debug mode it's works, but when I publish the code:
Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred while iterating over the results of a query for context type 'Devart.PostgreSql.SchedulerContext'.
System.ArgumentNullException: Value cannot be null.
Parameter name: queryCompilationContext
at Microsoft.EntityFrameworkCore.Utilities.Check.NotNull[T](T value, String parameterName)
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression..ctor(SelectExpressionDependencies dependencies, RelationalQueryCompilationContext queryCompilationContext)
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression.Clone(String alias)
at ? . ? ? (SelectExpression )
at ? . ? ? (SelectExpression )
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
at ? .VisitUnary(UnaryExpression )
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at ? .VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at ? . ? ? (Ordering )
at ? . ? ? (SelectExpression )
at ? . ? ? (SelectExpression )
at System.Linq.Expressions.ExpressionVisitor.VisitAndConvert[T](T node, String callerName)
at .CreateDefault(SelectExpression )
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.<NotifyReaderCreated>b__14_0(FactoryAndReader s)
at Microsoft.EntityFrameworkCore.Internal.NonCapturingLazyInitializer.EnsureInitialized[TParam,TValue](TValue& target, TParam param, Func`2 valueFactory)
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.NotifyReaderCreated(DbDataReader dataReader)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.AsyncSelectEnumerable`2.AsyncSelectEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
System.ArgumentNullException: Value cannot be null.
Parameter name: queryCompilationContext
at Microsoft.EntityFrameworkCore.Utilities.Check.NotNull[T](T value, String parameterName)
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression..ctor(SelectExpressionDependencies dependencies, RelationalQueryCompilationContext queryCompilationContext)
at Microsoft.EntityFrameworkCore.Query.Expressions.SelectExpression.Clone(String alias)
at ? . ? ? (SelectExpression )
at ? . ? ? (SelectExpression )
at System.Linq.Expressions.ExpressionVisitor.VisitUnary(UnaryExpression node)
at ? .VisitUnary(UnaryExpression )
at System.Linq.Expressions.UnaryExpression.Accept(ExpressionVisitor visitor)
at ? .VisitBinary(BinaryExpression )
at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
at ? . ? ? (Ordering )
at ? . ? ? (SelectExpression )
at ? . ? ? (SelectExpression )
at System.Linq.Expressions.ExpressionVisitor.VisitAndConvert[T](T node, String callerName)
at .CreateDefault(SelectExpression )
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.<NotifyReaderCreated>b__14_0(FactoryAndReader s)
at Microsoft.EntityFrameworkCore.Internal.NonCapturingLazyInitializer.EnsureInitialized[TParam,TValue](TValue& target, TParam param, Func`2 valueFactory)
at Microsoft.EntityFrameworkCore.Query.Internal.ShaperCommandContext.NotifyReaderCreated(DbDataReader dataReader)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.BufferlessMoveNext(DbContext _, Boolean buffer, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncQueryingEnumerable`1.AsyncEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.AsyncSelectEnumerable`2.AsyncSelectEnumerator.MoveNext(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.AsyncLinqOperatorProvider.ExceptionInterceptor`1.EnumeratorExceptionInterceptor.MoveNext(CancellationToken cancellationToken)
Value cannot be null.
Parameter name: queryCompilationContext
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
Please send us a small test project to reproduce the issue in our environment.
-
- Posts: 9
- Joined: Tue 21 Aug 2018 13:56
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
[url]https://drive.google.com/open?id=1 ... oDONFOHF0F[/url]
This exception throw when the application published in docker environment.
In debug mode it's works!
Run in application path:
- docker build -t devart:bug .
- docker run devart:bug
This exception throw when the application published in docker environment.
In debug mode it's works!
Run in application path:
- docker build -t devart:bug .
- docker run devart:bug
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
Thank you for your report. We have reproduced the issue and are investigating it.
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
We have sent the internal build to you by email.
Please test this build with your application. Additionally, set the following option in your code:
Please test this build with your application. Additionally, set the following option in your code:
Code: Select all
var config = Devart.Data.PostgreSql.Entity.Configuration.PgSqlEntityProviderConfig.Instance;
config.QueryOptions.Optimizations = Data.PostgreSql.Entity.Configuration.QueryOptimizations.None;
-
- Posts: 9
- Joined: Tue 21 Aug 2018 13:56
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
Hi! I received your internal build!
This internal build support .NET Core assemblies ?
This internal build support .NET Core assemblies ?
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
The NuGet packages for v7.13.1392 are uploaded to https://www.devart.com/pub/nuget_postgr ... 3_1392.zip.
-
- Posts: 9
- Joined: Tue 21 Aug 2018 13:56
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
Hi!
With your internal build it worked.
Will this be available in the next release version?
With your internal build it worked.
Will this be available in the next release version?
Code: Select all
var config = Devart.Data.PostgreSql.Entity.Configuration.PgSqlEntityProviderConfig.Instance;
config.QueryOptions.Optimizations = Data.PostgreSql.Entity.Configuration.QueryOptimizations.None;
Re: System.NotSupportedException: Unsupported literal primitive type kind 'DateTimeOffset'
Yes, it will. The property is public but not browsable.