Skip to content

Instantly share code, notes, and snippets.

@darkiri
Created March 14, 2012 22:17
Show Gist options
  • Save darkiri/2039990 to your computer and use it in GitHub Desktop.
Save darkiri/2039990 to your computer and use it in GitHub Desktop.
is there a method which returns all .net base types/structs that System.Convert is able to convert to/from?
typeof (Convert)
.GetMethods(BindingFlags.Static|BindingFlags.Public)
.Where(m=>m.Name.StartsWith("To"))
.Select(m=>m.GetParameters().First().ParameterType)
.Distinct()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment