This is a migrated thread and some comments may be shown as answers.

SUM of related table fields

4 Answers 96 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ubuntu
Top achievements
Rank 1
Ubuntu asked on 24 May 2011, 11:02 AM
Dear All,

I need to create a custom class to fetch some data, so I implement the following LINQ query:

var dailys = (from Summary in DataContext.summeries
join Period in DataContext.Periods on Summary.periodid equals Period.periodid
where
&& Summary.date >= Period.from
&& Summary.date <= Period.to
select new dailysummaryview
{
      period = Summary.periodid,
      month = Summary.month,
      total_x = Summary.dailies.Sum(k=>k.x),
      total_y = 8 //Summary.dailies.Sum(k => k.y)
 });
return dailys;


I always get the exception of :
Result type calculation: expected FieldNode, FieldNavNode, LiteralNode, AggregateNode, BinaryNode, ParamNode.

If I change the total_x to total_x = constant like total_y I got no exceptions.

What solution could be for that issue... anyboady knows.
Regards

4 Answers, 1 is accepted

Sort by
0
Thomas
Telerik team
answered on 27 May 2011, 05:05 PM
Hi Ubuntu,

thanks for reporting this issue; I will have a look into this on monday.

Best wishes,
Thomas
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
Ubuntu
Top achievements
Rank 1
answered on 30 May 2011, 08:16 PM
Hi Thomas,

Any updates on the issue ... !!

Regards
0
Thomas
Telerik team
answered on 03 Jun 2011, 10:50 PM
Hello Ubuntu,

yes, I can reproduce this now.  However I cannot give a concrete day yet when this problem is fixed. I will post here any updates on this.

Greetings,
Thomas
the Telerik team
Q1’11 SP1 of Telerik OpenAccess is available for download; also available is the Q2'11 Roadmap for Telerik OpenAccess ORM.
0
Ubuntu
Top achievements
Rank 1
answered on 04 Jun 2011, 03:23 PM
thanks thomas
i guess i wil move back to my ef4

regards
Tags
LINQ (LINQ specific questions)
Asked by
Ubuntu
Top achievements
Rank 1
Answers by
Thomas
Telerik team
Ubuntu
Top achievements
Rank 1
Share this question
or