UPDATE: As of EF7 preview 7, now you simply use string.Join
normally for example:
_context.MyTable
.GroupBy(keySelector => keySelector.MyKey, elemSelector => elemSelector.StringProp)
.Select(elem => string.Join(',', elem))
//.FirstOrDefaultAsync(cancellationToken), if (keyselector => 1) i.e. only 1 group so you get all rows
Old answer
Well, as per this this issue, string.Join() is yet to be implemented(as of now) and IEnumerable.Aggregate will not translate either.
In the meanwhile, you can create a view and write your SQL there.
For example, to group by id and string.Join(", ", Names);
CREATE VIEW V_Name AS
SELECT ID,
Names=STUFF
(
(
SELECT DISTINCT ' || '+ CAST(Child.Name AS VARCHAR(MAX))
FROM Child,MainTable
WHERE Main.ID= t1.ID --this line is imp...
AND Child.ID=MainTable.ID
FOR XMl PATH('')
),1,1,''
)
FROM MainTable t1
GROUP BY t1.IDReview
OR
CREATE VIEW V_Name AS
SELECT ID, STRING_AGG(Name, ', ') AS Names
FROM MainTable
LEFT JOIN ChildTable ON MainTable.ID = ChildTable.ID
GROUP BY ID
Now, in your C# you can simply join this with your ID, just like you normally would with an IQueryable:
from data in _dbcontext.sometable
join groupedAndJoinedNames in _dbcontext.viewname
on data.ID equals groupedAndJoinedNames.ID
select new
{
Names = groupedAndJoinedNames.Names
}