Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. // Incomplete code snippet assumes variable Item item with list field "References" and IEnumerable<ID> references
  2.  
  3. Sitecore.Text.ListString referencesValue = new Sitecore.Text.ListString();
  4.  
  5. foreach(ID id in references)
  6. {
  7. string idString = id.ToString();
  8. if (!referencesValue.Contains(idString))
  9. {
  10. referencesValue.Add(idString);
  11. }
  12. }
  13.  
  14. item.Editing.BeginEdit();
  15. item["References"] = referencesValue.ToString();
  16. item.Editing.EndEdit();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement