Skip to content

Instantly share code, notes, and snippets.

@mastoj
Created May 10, 2011 08:05
Show Gist options
  • Save mastoj/964078 to your computer and use it in GitHub Desktop.
Save mastoj/964078 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
namespace DynamicTest
{
class Program
{
static void Main(string[] args)
{
var listOfStuff = new List<string> {"show", "me", "the", "universe", "!"};
dynamic selection = listOfStuff.Select(y => new {Title = y});
foreach (var myDynamic in selection)
{
Console.WriteLine(myDynamic.Title);
}
dynamic d = new {Title = "Show me the universe!"};
Console.WriteLine(d.Title);
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment