Skip to content

Instantly share code, notes, and snippets.

@mletterle
Created January 5, 2010 01:44
Show Gist options
  • Save mletterle/269062 to your computer and use it in GitHub Desktop.
Save mletterle/269062 to your computer and use it in GitHub Desktop.
class Program
{
static void Main(string[] args)
{
string s = "foo";
Action result =
s == "bar" ? (Action)(() => { Console.WriteLine("bar"); }):
s == "foo" ? (Action)(() => { Console.WriteLine("foo"); }) :
(Action)(() => { Console.WriteLine(); });
result.Invoke();
Console.ReadLine();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment