Skip to content

Instantly share code, notes, and snippets.

@sotirisf
Last active August 29, 2015 14:15
Show Gist options
  • Save sotirisf/38ccd871bd343cd1f1e5 to your computer and use it in GitHub Desktop.
Save sotirisf/38ccd871bd343cd1f1e5 to your computer and use it in GitHub Desktop.
Create a comma-delimited list from an IEnumerable collection of Umbraco IPublishedContent Ids
var storedVal = content.Aggregate<IPublishedContent, StringBuilder, string>(
new StringBuilder()
, (sb, x) => sb.Append(x.Id).Append((content.Last().Id==x.Id) ? "" : ",")
, (sb) => sb.ToString()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment