The code is sent to Dmitriy's mail. The code looks like this:

Session.Current.Query.All<BondPayment.TpSumToPayment>()
.GroupBy(e => e.Id)
.Select(grp => new { grp.Key, sum1 = grp.Sum(e => e.TotalSum), sum2 = grp.Sum(e => e.MaturitySum)})
.FirstOrDefault();

[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index]
   System.Collections.Generic.List`1.get_Item(Int32 index) +12732076
   Xtensive.Collections.ReadOnlyList`1.get_Item(Int32 index) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Collections\ReadOnlyList{T}.cs:61
   Xtensive.Storage.Rse.Providers.Compilable.AggregateProvider..ctor(CompilableProvider source, Int32[] groupIndexes, AggregateColumnDescriptor[] columnDescriptors) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Storage\Rse\Providers\Compilable\AggregateProvider.cs:195
   Xtensive.Orm.Linq.Translator.VisitAggregate(Expression source, MethodInfo method, LambdaExpression argument, Boolean isRoot, MethodCallExpression expressionPart) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:665
   Xtensive.Orm.Linq.Translator.VisitQueryableMethod(MethodCallExpression mc, QueryableMethodKind methodKind) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:209
   Xtensive.Linq.QueryableVisitor.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\QueryableVisitor.cs:34
   Xtensive.Orm.Linq.Translator.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:401
   Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:106
   Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:84
   Xtensive.Orm.Linq.Translator.VisitMemberAssignment(MemberAssignment ma) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:143
   Xtensive.Linq.ExpressionVisitor.VisitBinding(MemberBinding binding) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor.cs:220
   Xtensive.Linq.ExpressionVisitor.VisitBindingList(ReadOnlyCollection`1 original) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor.cs:255
   Xtensive.Orm.Linq.Translator.VisitMemberInit(MemberInitExpression mi) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:988
   Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:122
   Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:84
   Xtensive.Orm.Linq.Translator.VisitLambda(LambdaExpression le) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:125
   Xtensive.Orm.Linq.Translator.BuildProjection(LambdaExpression le) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:1070
   Xtensive.Orm.Linq.Translator.VisitSelect(Expression expression, LambdaExpression le) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:1061
   Xtensive.Orm.Linq.Translator.VisitQueryableMethod(MethodCallExpression mc, QueryableMethodKind methodKind) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:185
   Xtensive.Linq.QueryableVisitor.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\QueryableVisitor.cs:34
   Xtensive.Orm.Linq.Translator.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:401
   Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:106
   Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:84
   Xtensive.Orm.Linq.Translator.VisitSequence(Expression sequenceExpression, Expression expressionPart) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:1324
   Xtensive.Orm.Linq.Translator.VisitSequence(Expression sequenceExpression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:1288
   Xtensive.Orm.Linq.Translator.VisitFirstSingle(Expression source, LambdaExpression predicate, MethodInfo method, Boolean isRoot) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:391
   Xtensive.Orm.Linq.Translator.VisitQueryableMethod(MethodCallExpression mc, QueryableMethodKind methodKind) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Queryable.cs:111
   Xtensive.Linq.QueryableVisitor.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\QueryableVisitor.cs:34
   Xtensive.Orm.Linq.Translator.VisitMethodCall(MethodCallExpression mc) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:401
   Xtensive.Linq.ExpressionVisitor`1.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Core\Xtensive.Core\Linq\ExpressionVisitor{TResult}.cs:106
   Xtensive.Orm.Linq.Translator.Visit(Expression e) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Expressions.cs:84
   Xtensive.Orm.Linq.Translator.Translate() in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\Translator.Materialization.cs:33
   Xtensive.Orm.Linq.QueryProvider.Translate(Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\QueryProvider.cs:80

[QueryTranslationException: Unable to translate 'Query.All().Where(entTpSumToPayment => (entTpSumToPayment.Owner.Id == $<Guid>(77498362-467c-f2f9-dfe3-0d2a8486c263))).Select(q => new @<Item, FakeKey>(
  q,
  0
)).GroupBy(i => i.FakeKey).Select( => new DynamicClass73() {
  Count = .Count(),
  Sum = .Sum( => .Item.Sum),
  TotalSum = .Sum( => .Item.TotalSum),
  FinToolQty = .Sum( => .Item.FinToolQty),
  MaturitySum = .Sum( => .Item.MaturitySum)
}).FirstOrDefault()' expression. See inner exception for details.]
   Xtensive.Orm.Linq.QueryProvider.Translate(Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\QueryProvider.cs:85
   Xtensive.Orm.Linq.QueryProvider.Execute(Expression expression) in c:\Projects\dataobjects.net\Xtensive.Orm\Xtensive.Orm\Orm\Linq\QueryProvider.cs:69
   System.Linq.Queryable.FirstOrDefault(IQueryable`1 source) +383
   Werp.Controller.Services.GridReadService`1.GetObject() in c:\BuildAgent\work\71deae282d9c6038\Werp.Controller.Services\GridReadService.cs:116
   Werp.View.ExtNet.Handlers.ReadHandler.ProcessRequest(HttpContext context) in c:\BuildAgent\work\71deae282d9c6038\Werp.View.ExtNet\Handlers\ReadHandler.ashx.cs:190
   Werp.View.ExtNet.Handlers.Dispatcher.ProcessRequest(HttpContext context) in c:\BuildAgent\work\71deae282d9c6038\Werp.View.ExtNet\Handlers\Dispatcher.cs:73
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

asked Sep 12 '11 at 08:13

xumix's gravatar image

xumix
425737682

edited Sep 12 '11 at 08:14

Hello xumix,

We'll chech this.

Btw, send kind regards to your query generating machine. Hope it is doing well. =)

(Sep 16 '11 at 10:42) Dmitri Maximov Dmitri%20Maximov's gravatar image

Isn't this fixed?

(Sep 17 '12 at 03:35) xumix xumix'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