Skip to content

Instantly share code, notes, and snippets.

@tugberkugurlu
Created March 1, 2013 19:18
Show Gist options
  • Save tugberkugurlu/5067026 to your computer and use it in GitHub Desktop.
Save tugberkugurlu/5067026 to your computer and use it in GitHub Desktop.
IsAssignableFrom
class Program {
static void Main(string[] args) {
var type = typeof(Foo);
var isIFoo = typeof(IFoo).IsAssignableFrom(type);
}
}
public interface IFoo {
void Do();
}
public class Foo : IFoo {
public void Do() {
Console.WriteLine("Done!");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment