I have a query Like below in .net Core 2.2 with EF.
var data = context.Customer
.GroupJoin(context.Orders, c=> c.Id, o => o.CustoerId, (c, o) => new
{
customer = c,
orders= o
}).Select(s => new
{
s.customer.Name,
s.customer.Id,
AllOrdersRef = s.orders == null ? null : string.Join(", ", s.orders.Select(x => x.UniquRef))
});
It gives Error
The LINQ expression 'Count()' could not be translated and will be evaluated locally.
All I want is Comma Separated Value in AllOrdersRef. Also I dont want to use ToList().