Created
March 23, 2017 13:51
-
-
Save jackmott/7247544a3a3312743b04c9566324e200 to your computer and use it in GitHub Desktop.
c# 7 pattern matching
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
| switch (SomeClass) | |
| { | |
| case DerivedClassA a: | |
| a.dostuff(); | |
| break; | |
| case DerivedClassB b: | |
| b.dostuff(); | |
| break; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment