Hi,
I’m getting the error “must be reducible node” when executing the following query:
var emailMessages = lda.GetTable<EmailMessages>();
var emailNotifications = lda.GetTable<EmailNotifications>();
var query = from e in emailMessages
where (e.MessageId == messageId)
join n in emailNotifications
on new { Id = e.Email_Message_ID }
equals new { Id = n.Email_Message_ID } into n1
from n2 in n1.DefaultIfEmpty()
select new { Email = e, Notifications = n2 };
var result = query.ToList();
This is the call stack:
System.ArgumentException: must be reducible node
at System.Linq.Expressions.Expression.ReduceAndCheck()
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(Expression node, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.ChildRewriter.Add(Expression expression)
at System.Linq.Expressions.Compiler.StackSpiller.ChildRewriter.AddArguments(IArgumentProvider expressions)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteNewExpression(Expression expr, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(Expression node, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpressionFreeTemps(Expression expression, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.Rewrite[T](Expression`1 lambda)
at System.Linq.Expressions.Expression`1.Accept(StackSpiller spiller)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteLambdaExpression(Expression expr)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(Expression node, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.ChildRewriter.Add(Expression expression)
at System.Linq.Expressions.Compiler.StackSpiller.ChildRewriter.AddArguments(IArgumentProvider expressions)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteNewExpression(Expression expr, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(Expression node, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.ChildRewriter.Add(Expression expression)
at System.Linq.Expressions.Compiler.StackSpiller.ChildRewriter.AddArguments(IArgumentProvider expressions)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteInvocationExpression(Expression expr, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(Expression node, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteUnaryExpression(Expression expr, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpression(Expression node, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.RewriteExpressionFreeTemps(Expression expression, Stack stack)
at System.Linq.Expressions.Compiler.StackSpiller.Rewrite[T](Expression`1 lambda)
at System.Linq.Expressions.Expression`1.Accept(StackSpiller spiller)
at System.Linq.Expressions.Compiler.LambdaCompiler.Compile(LambdaExpression lambda)
at RemObjects.DataAbstract.Linq.LinqDataAdapter.FillMethod(Int32[] offsets, IDataReader reader, RequestData request, Expression expression) in c:\CI\b\rofx\932\Data Abstract for .NET\Source\RemObjects.DataAbstract\Linq\LinqDataAdapter.pas:line 875
at RemObjects.DataAbstract.Linq.RemoteTable`1.<>c__DisplayClass0.<Execute>b__0(Int32 index, Int32[] offsets, IDataReader reader) in c:\CI\b\rofx\932\Data Abstract for .NET\Source\RemObjects.DataAbstract\Linq\RemoteTable.pas:line 293
at RemObjects.DataAbstract.Linq.LinqRemoteDataAdapter.FetchData(TableRequestInfo[] tableRequest, String[] tableNames, Action`3 fillMethod) in c:\CI\b\rofx\932\Data Abstract for .NET\Source\RemObjects.DataAbstract\Linq\LinqRemoteDataAdapter.pas:line 431
at RemObjects.DataAbstract.Linq.RemoteTable`1.Execute(Expression expression, DataParameter[] parameters) in c:\CI\b\rofx\932\Data Abstract for .NET\Source\RemObjects.DataAbstract\Linq\RemoteTable.pas:line 296
at RemObjects.DataAbstract.Linq.RemoteTableQuery`1.GetEnumerator() in c:\CI\b\rofx\932\Data Abstract for .NET\Source\RemObjects.DataAbstract\Linq\RemoteTableQuery.pas:line 74
at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
(...)
The project is a .NET Core 2.1 project, using the NetStandard assemblies. Is there something wrong with the LINQ statement? If I change it to an inner join, it works fine.
Thanks,
Arturo.