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

LINQ query with Aggregate Error!!

0 Answers 16 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ubuntu
Top achievements
Rank 1
Ubuntu asked on 24 Apr 2013, 01:13 PM
Dear All,
    I have this Linq query to combine a list of values (Names) form the child table into one string
    
team.TeamMembers.Where(o => o.TeamId == team.ID).Select(i => i.Member.Name).Aggregate((x, y) => x + y)

    the result is taken to a string properity on the returned class.
    When I preview the report I got this error:
    
An error has occurred while processing Report 'TeamFollowUp': An error occurred while invoking data retrieval method. Try restarting VisualStudio.
------------- InnerException -------------
Exception has been thrown by the target of an invocation.
------------- InnerException -------------
LINQ to Entities does not recognize the method 'System.String Aggregate[String](System.Collections.Generic.IEnumerable`1[System.String], System.Func`3[System.String,System.String,System.String])' method, and this method cannot be translated into a store expression.
    
How can I correct this ...!!!

Regards

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Ubuntu
Top achievements
Rank 1
Share this question
or