Skip to content

Instantly share code, notes, and snippets.

@jfromaniello
Created June 2, 2010 23:40
Show Gist options
  • Save jfromaniello/423191 to your computer and use it in GitHub Desktop.
Save jfromaniello/423191 to your computer and use it in GitHub Desktop.
var query = new[] {1, 2, 3, 4, 5, 6, 7}.Select(i => {
dynamic expando = new ExpandoObject();
expando.i = i;
expando.root = () => i * i;
return expando
});
foreach(dynamic item in query){
Console.WriteLine(item.root());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment