I have two table Company and Employee. And there relation is Company(one) - Employee(many).
And I want to concatenate all the Employees' name to a string and output.
I know I can write such a query :
String names = "";
foreach(var emp in Company.Employee)
{
names += emp.name;
}
But If I use this mean, I would load all the employee records into memory, and then make comparison, which is a waste of time and memory, and would low the performance. So in linq, is it possible to craft such a query that can return all concatenated names within a single SQL ?
Thanks in advance ! Any recommendations will be greatly appreciated !