Created
May 10, 2011 08:05
-
-
Save mastoj/964078 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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