Created
September 28, 2017 10:26
-
-
Save NMZivkovic/73413362d8347e2185ffeb624b7f8bf2 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
foreach (var shape in shapes) | |
{ | |
switch(shape.Value) | |
{ | |
case Rectangle r: | |
Console.WriteLine(r.Height); | |
break; | |
case Circle c: | |
Console.WriteLine(2 * c.Radius); | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment