Skip to content

Instantly share code, notes, and snippets.

@davidalpert
Created November 8, 2013 22:41
Show Gist options
  • Select an option

  • Save davidalpert/7378855 to your computer and use it in GitHub Desktop.

Select an option

Save davidalpert/7378855 to your computer and use it in GitHub Desktop.
A convenience method that inverts IsAssignableFrom to be semantically more straightforward.
/// <summary>
/// A convenience method that inverts <see cref="IsAssignableFrom"/> to be
/// semantically more straightforward.
/// </summary>
public static bool IsAssignableTo(this Type source, Type target)
{
return target.IsAssignableFrom(source);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment