I have a table of blog entries, a table of tags, and a table that intersects the tags to a blog entry.
I want to roll-up the tags of a blog entry into a comma delimited string to be returned in the same result set. This is how I've done it in SQL:
select
be.Title
,Tags = lower((
select
stuff((
select distinct
',' + bc.Category
from
BlogEntryCategory bec
join BlogCategory bc on bc.BlogCategory_ID = bec.BlogCategory_ID
where
bec.BlogEntry_ID = be.BlogEntry_ID
for xml path('')),1,1,'')
)
)
from
BlogEntry be
I'm using for xml path to roll my tags up and I'm looking for the equivalent way to do this with LINQ.