Created
March 17, 2017 11:14
-
-
Save DavidArno/ec6654e48d82143dbd8dd0f89b67bfb5 to your computer and use it in GitHub Desktop.
Siwtch on type of T example for Jonathan Channon
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
public void F<T>() | |
{ | |
switch (typeof(T)) | |
{ | |
case Type t when t == typeof(Foo): break; | |
case Type t when t == typeof(Bar): break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment