Skip to content

Instantly share code, notes, and snippets.

@rarous
Created November 6, 2012 09:41
Show Gist options
  • Select an option

  • Save rarous/4023721 to your computer and use it in GitHub Desktop.

Select an option

Save rarous/4023721 to your computer and use it in GitHub Desktop.
static XElement XSection<T>(string name, T[] items)
{
if (items == null || !items.Any())
return null;
return new XElement(name, from dynamic item in items select item.ToXElement());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment