Last active
August 29, 2015 14:15
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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