Skip to content

Instantly share code, notes, and snippets.

@DavidArno
Created March 17, 2017 11:14
Show Gist options
  • Save DavidArno/ec6654e48d82143dbd8dd0f89b67bfb5 to your computer and use it in GitHub Desktop.
Save DavidArno/ec6654e48d82143dbd8dd0f89b67bfb5 to your computer and use it in GitHub Desktop.
Siwtch on type of T example for Jonathan Channon
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