When we create buggy custom compiler with expression that returns incompatible type for field we got this exception:

Xtensive.Orm.QueryTranslationException occurred
      Message=Unable to translate 'Query.All().OrderByDescending( => .Currency.Name).Skip(() => $<ReadService<DocOrderCreditDebitStock>>(Werp.Controller.Services.GridReadService`1[Eis.Models.Documents.Orders.DocOrderCreditDebitStock]).Start).Take(() => $<ReadService<DocOrderCreditDebitStock>>(Werp.Controller.Services.GridReadService`1[Eis.Models.Documents.Orders.DocOrderCreditDebitStock]).Limit).Select( => new DynamicClass3() {
      Id = .Id,
[hundreds LOC]
    })' expression. See inner exception for details.
      Source=Xtensive.Orm
      StackTrace:
           at Xtensive.Orm.Linq.QueryProvider.Translate[TResult](Expression expression)
      InnerException: System.ArgumentException
           Message=Argument types do not match
           Source=System.Core
           StackTrace:
                at System.Linq.Expressions.Expression.Bind(MemberInfo member, Expression expression)
                at Xtensive.Orm.Linq.Translator.VisitMemberAssignment(MemberAssignment ma)
                at Xtensive.Linq.ExpressionVisitor.VisitBinding(MemberBinding binding)
                at Xtensive.Linq.ExpressionVisitor.VisitBindingList(ReadOnlyCollection`1 original)
                at Xtensive.Orm.Linq.Translator.VisitMemberInit(MemberInitExpression mi)
                at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e)
                at Xtensive.Orm.Linq.Translator.Visit(Expression e)
                at Xtensive.Orm.Linq.Translator.VisitLambda(LambdaExpression le)
                at Xtensive.Orm.Linq.Translator.BuildProjection(LambdaExpression le)
                at Xtensive.Orm.Linq.Translator.VisitSelect(Expression expression, LambdaExpression le)
                at Xtensive.Orm.Linq.Translator.VisitQueryableMethod(MethodCallExpression mc, QueryableMethodKind methodKind)
                at Xtensive.Linq.QueryableVisitor.VisitMethodCall(MethodCallExpression mc)
                at Xtensive.Orm.Linq.Translator.VisitMethodCall(MethodCallExpression mc)
                at Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e)
                at Xtensive.Orm.Linq.Translator.Visit(Expression e)
                at Xtensive.Orm.Linq.Translator.Translate[TResult]()
                at Xtensive.Orm.Linq.QueryProvider.Translate[TResult](Expression expression)
           InnerException:

And we don't have any information of Field and Type that incompatible Could you include in exception information of Field and Type ?

asked Jun 09 '11 at 08:27

pil0t's gravatar image

pil0t
207575763

edited Jun 09 '11 at 08:28

Thanks, pil0t,

Will do.

(Jun 14 '11 at 07:19) Dmitri Maximov Dmitri%20Maximov's gravatar image
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

powered by OSQA