Created
September 28, 2017 10:11
-
-
Save NMZivkovic/9df07b4fe89eaa50a48f595421bee557 to your computer and use it in GitHub Desktop.
This file contains 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
string data = "Item1"; | |
var action1 = new Action(() => { Console.Write("This is one!"); }); | |
var action2 = new Action(() => { Console.Write("This is two!"); }); | |
var action3 = new Action(() => { Console.Write("This is three!"); }); | |
switch (data) | |
{ | |
case "Item1": | |
action1(); | |
break; | |
case "Item2": | |
action2(); | |
break; | |
default: | |
action3(); | |
break; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment