Exception using <arr>.Contains in query

Exception using <arr>.Contains in query

Postby powelerl » Tue 31 Oct 2017 14:39

v9.5 NuGet - happens for both net47 and netcoreapp2.0

Code: Select all
Where(c => capabilityNames.Contains(c.CapabilityName))

capabilityNames is a plain string array. This code worked fine in v9.4.

Code: Select all
System.InvalidCastException occurred
  HResult=0x80004002
  Message=Unable to cast object of type 'Devart.Common.Entity.v' to type 'Microsoft.EntityFrameworkCore.Query.Expressions.AliasExpression'.
  Source=Devart.Data.Oracle.Entity.EFCore
  StackTrace:
   at System.Data.Common.CommandTrees.a.b(InExpression A_0)
   at System.Data.Common.CommandTrees.a.Visit(Expression node)
   at System.Data.Common.CommandTrees.a.f(SelectExpression A_0)
   at System.Data.Common.CommandTrees.b.d(SelectExpression A_0)
   at System.Data.Common.CommandTrees.a.e(SelectExpression A_0)
   at System.Data.Common.CommandTrees.a.Visit(Expression node)
   at System.Linq.Expressions.ExpressionVisitor.VisitAndConvert[T](T node, String callerName)
   at Devart.Data.Oracle.Entity.be.a(SelectExpression A_0)
   at Microsoft.EntityFrameworkCore.Query.Internal.RelationalExpressionPrinter.CommandBuilderPrinter.TryPrintConstant(ConstantExpression constantExpression, IndentedStringBuilder stringBuilder, Boolean removeFormatting)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitConstant(ConstantExpression constantExpression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.VisitLambda[T](Expression`1 lambdaExpression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Visit(Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.PrintInternal(Expression expression, Boolean removeFormatting, Nullable`1 characterLimit, Boolean highlightNonreducibleNodes)
   at Microsoft.EntityFrameworkCore.Query.Internal.ExpressionPrinter.Print(Expression expression, Boolean removeFormatting, Nullable`1 characterLimit)
   at Microsoft.EntityFrameworkCore.Internal.CoreLoggerExtensions.QueryExecutionPlanned(IDiagnosticsLogger`1 diagnostics, IExpressionPrinter expressionPrinter, Expression queryExecutorExpression)
   at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.CreateExecutorLambda[TResults]()
   at Microsoft.EntityFrameworkCore.Query.EntityQueryModelVisitor.CreateQueryExecutor[TResult](QueryModel queryModel)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](Expression query, INodeTypeProvider nodeTypeProvider, IDatabase database, IDiagnosticsLogger`1 logger, Type contextType)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass15_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 compiler)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
   at Remotion.Linq.QueryableBase`1.GetEnumerator()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at Powel.ManagedMetalayer.NetbasIntegration.NetbasMetalayerMetadata.<>c__DisplayClass76_0.<Load>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
powelerl
 
Posts: 23
Joined: Thu 22 Dec 2016 10:00

Re: Exception using <arr>.Contains in query

Postby Shalex » Wed 01 Nov 2017 14:54

Thank you for your report. We have reproduced the issue and will notify you when it is fixed.
Shalex
Devart Team
 
Posts: 7777
Joined: Thu 14 Aug 2008 12:44

Re: Exception using <arr>.Contains in query

Postby powelerl » Tue 14 Nov 2017 10:39

Do you know when I can expect a new release?
powelerl
 
Posts: 23
Joined: Thu 22 Dec 2016 10:00

Re: Exception using <arr>.Contains in query

Postby Shalex » Wed 15 Nov 2017 14:04

We are planning to release the new public build next week. We have just sent the internal build with the fix to the email specified in your forum profile.
Shalex
Devart Team
 
Posts: 7777
Joined: Thu 14 Aug 2008 12:44

Re: Exception using <arr>.Contains in query

Postby astrix » Wed 15 Nov 2017 22:43

We are also waiting for this fix, is it possible to get the internal build ?
astrix
 
Posts: 1
Joined: Wed 15 Nov 2017 10:08

Re: Exception using <arr>.Contains in query

Postby powelerl » Thu 16 Nov 2017 11:29

The internal build works fine, for both .NET Core and .NET Framework. Thanks!
powelerl
 
Posts: 23
Joined: Thu 22 Dec 2016 10:00

Re: Exception using <arr>.Contains in query

Postby Shalex » Thu 16 Nov 2017 13:26

astrix wrote:We are also waiting for this fix, is it possible to get the internal build ?
We have just sent the NuGet packages with the fix to the email specified in your forum profile.

powelerl wrote:The internal build works fine, for both .NET Core and .NET Framework. Thanks!
Thank you for letting us know.
Shalex
Devart Team
 
Posts: 7777
Joined: Thu 14 Aug 2008 12:44

Re: Exception using <arr>.Contains in query

Postby janidbest » Tue 21 Nov 2017 00:04

Same problem here, having this issue when using with .NET Core app.
Appreciate your help
janidbest
 
Posts: 2
Joined: Mon 20 Nov 2017 05:58


Return to dotConnect for Oracle