-
-
Save dimitris-papadimitriou-chr/1e8e8a589c72d68b5d00b090bf1eeaba 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
| string GetShapeDescription1(Shape shape) | |
| { | |
| if (shape is Circle) | |
| return $"found a circle with radius {(shape as Circle).Radius}"; | |
| if (shape is Rectangle) | |
| return $"Found {(shape as Rectangle).Height }x {(shape as Rectangle).Width} rectangle"; | |
| throw new System.Exception(nameof(shape)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment