Possible dublicate of http://support.x-tensive.com/question/4616/linq-translation-exceptions-unable-to-translate-exception Here is examples/tests: http://narod.ru/disk/26506398001/Project1.7z.html http://narod.ru/disk/26506482001/Project2.7z.html

Stacktraces:

Xtensive.Orm.QueryTranslationException was unhandled
  Message=Unable to translate 'Query.All().Where(a => @.qw.Contains(a.FieldName.Id))' expression. See inner exception for details.
  Source=Xtensive.Orm
  StackTrace:
       at Xtensive.Orm.Linq.QueryProvider.Translate[TResult](Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\QueryProvider.cs:line 85
       at Xtensive.Orm.Linq.QueryProvider.Execute[TResult](Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\QueryProvider.cs:line 69
       at Xtensive.Orm.Linq.Queryable`1.GetEnumerator() in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Queryable.cs:line 65
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
       at Project1.Program.Main(String[] args) in D:\DataObjectsBugs\Project1\Project1\Project1\Program.cs:line 25
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.InvalidOperationException
       Message=Operation is not valid due to the current state of the object.
       Source=Xtensive.Orm
       StackTrace:
            at Xtensive.Orm.Linq.Expressions.Visitors.IncludeFilterMappingGatherer.VisitBinary(BinaryExpression b) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Expressions\Visitors\IncludeFilterMappingGatherer.cs:line 37
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 88
            at Xtensive.Linq.ExpressionVisitor.VisitConditional(ConditionalExpression c) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor.cs:line 102
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 94
            at Xtensive.Linq.ExpressionVisitor.VisitBinary(BinaryExpression b) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor.cs:line 78
            at Xtensive.Orm.Linq.Expressions.Visitors.IncludeFilterMappingGatherer.VisitBinary(BinaryExpression b) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Expressions\Visitors\IncludeFilterMappingGatherer.cs:line 37
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 88
            at Xtensive.Orm.Linq.Expressions.Visitors.IncludeFilterMappingGatherer.Visit(Expression tupleExpression, Int32 length, Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Expressions\Visitors\IncludeFilterMappingGatherer.cs:line 27
            at Xtensive.Orm.Linq.Translator.VisitExists(Expression source, LambdaExpression predicate, Boolean notExists) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:line 1152
            at Xtensive.Orm.Linq.Translator.VisitContains(Expression source, Expression match, Boolean isRoot) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:line 357
            at Xtensive.Orm.Linq.Translator.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 398
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 106
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.VisitLambda(LambdaExpression le) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 125
            at Xtensive.Orm.Linq.Translator.VisitWhere(Expression expression, LambdaExpression le) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:line 1092
            at Xtensive.Orm.Linq.Translator.VisitQueryableMethod(MethodCallExpression mc, QueryableMethodKind methodKind) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:line 227
            at Xtensive.Linq.QueryableVisitor.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\QueryableVisitor.cs:line 34
            at Xtensive.Orm.Linq.Translator.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 401
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 106
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.Translate[TResult]() in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Materialization.cs:line 33
            at Xtensive.Orm.Linq.QueryProvider.Translate[TResult](Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\QueryProvider.cs:line 80
       InnerException:

And

Xtensive.Orm.QueryTranslationException occurred
  Message=Unable to translate 'Query.All().Where(a => @.qw.Contains(a.FieldName.Id))' expression. See inner exception for details.
  Source=Xtensive.Orm
  StackTrace:
       at Xtensive.Orm.Linq.QueryProvider.Translate[TResult](Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\QueryProvider.cs:line 85
  InnerException: System.ArgumentOutOfRangeException
       Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
       Source=mscorlib
       ParamName=index
       StackTrace:
            at System.Collections.Generic.List`1.get_Item(Int32 index)
            at Xtensive.Collections.ReadOnlyList`1.get_Item(Int32 index) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Collections\ReadOnlyList{T}.cs:line 61
            at Xtensive.Storage.Rse.Providers.Compilable.JoinProvider.Initialize() in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Storage\Rse\Providers\Compilable\JoinProvider.cs:line 60
            at Xtensive.Storage.Rse.Providers.Provider.Initialize(Type ctorType) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Storage\Rse\Providers\Provider.cs:line 92
            at Xtensive.Storage.Rse.Providers.Compilable.JoinProvider..ctor(CompilableProvider left, CompilableProvider right, JoinType joinType, JoinAlgorithm joinAlgorithm, Pair`1[] equalIndexes) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Storage\Rse\Providers\Compilable\JoinProvider.cs:line 88
            at Xtensive.Storage.Rse.RecordQueryExtensions.LeftJoin(RecordQuery left, RecordQuery right, JoinAlgorithm joinAlgorithm, Pair`1[] joinedColumnIndexes) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Storage\Rse\RecordQueryExtensions.cs:line 154
            at Xtensive.Orm.Linq.Translator.VisitTypeAs(Expression source, Type targetType) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 1151
            at Xtensive.Orm.Linq.Translator.VisitUnary(UnaryExpression u) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 100
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 63
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.VisitBinary(BinaryExpression binaryExpression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 185
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 88
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Linq.ExpressionVisitor.VisitConditional(ConditionalExpression c) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor.cs:line 102
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 94
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.VisitMemberAccess(MemberExpression ma) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 272
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 103
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.VisitMemberAccess(MemberExpression ma) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 314
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 103
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.VisitBinary(BinaryExpression binaryExpression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 186
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 88
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.VisitLambda(LambdaExpression le) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 125
            at Xtensive.Orm.Linq.Translator.VisitExists(Expression source, LambdaExpression predicate, Boolean notExists) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:line 1144
            at Xtensive.Orm.Linq.Translator.VisitContains(Expression source, Expression match, Boolean isRoot) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:line 357
            at Xtensive.Orm.Linq.Translator.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 398
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 106
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.VisitLambda(LambdaExpression le) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 125
            at Xtensive.Orm.Linq.Translator.VisitWhere(Expression expression, LambdaExpression le) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:line 1092
            at Xtensive.Orm.Linq.Translator.VisitQueryableMethod(MethodCallExpression mc, QueryableMethodKind methodKind) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:line 227
            at Xtensive.Linq.QueryableVisitor.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\QueryableVisitor.cs:line 34
            at Xtensive.Orm.Linq.Translator.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 401
            at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:line 106
            at Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:line 84
            at Xtensive.Orm.Linq.Translator.Translate[TResult]() in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Materialization.cs:line 33
            at Xtensive.Orm.Linq.QueryProvider.Translate[TResult](Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\QueryProvider.cs:line 80
       InnerException:

asked Sep 27 '11 at 07:22

pil0t's gravatar image

pil0t
207535763

Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

Subscription:

Once you sign in you will be able to subscribe for any updates here

Tags:

×56
×5

Asked: Sep 27 '11 at 07:22

Seen: 1,240 times

Last updated: Sep 27 '11 at 07:22

powered by OSQA