Let’s say I have two entities:
Physician
Credentials
And a physician can have many credentials, such as Dr. Jones can have MD, DO, MPH as credentials. So I need to generate a report via Linq that concatenates the credentials into a single string. For example:
from p in Physicians
select
{
p.Name
p.Credentials (??? <- concatenated list of all credentials ?????)
}
I have played with “p.Credentials.Aggregate((a,b) => a.Abrev + ',' + b.Abrev)” to no avail, but I’m not sure I have the syntax correct.
Uhm…. I’ve not tested it, but you can try:
Into the Select, I think x must be Credential, not Credentials…
EDIT
You need to move your objects into memory, try adding ToList() before make the Select