Skip to content

Instantly share code, notes, and snippets.

@lmatt-bit
Created April 9, 2014 11:28
Show Gist options
  • Select an option

  • Save lmatt-bit/10257630 to your computer and use it in GitHub Desktop.

Select an option

Save lmatt-bit/10257630 to your computer and use it in GitHub Desktop.
Test if a type is IList<>(generic type)
public static bool IsList(Type type)
{
return type != null && type.GetGenericTypeDefinition() == typeof(IList<>);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment