Skip to content

Instantly share code, notes, and snippets.

@ebello
Forked from dieseltravis/gist:2247
Created July 24, 2008 19:14
Show Gist options
  • Save ebello/2255 to your computer and use it in GitHub Desktop.
Save ebello/2255 to your computer and use it in GitHub Desktop.
public T RandomItem()
{
int randomRI = 0;
Random random = new Random();
lock (random)
{
randomRI = random.Next(0, this.Count - 1);
}
return this[randomRI];
}
BrandEnsemble.Framework.RelatedItems.Components.RelatedItem ri = BrandEnsemble.Framework.RelatedItems.RelatedItems.GetAllRelatedItems().RandomItem();
riList.Filter(new string[] {"Caption"}, String.Empty, FilterOperand.NotEquals);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment