Skip to content

Instantly share code, notes, and snippets.

@atheken
Created March 19, 2010 21:24
Show Gist options
  • Save atheken/338206 to your computer and use it in GitHub Desktop.
Save atheken/338206 to your computer and use it in GitHub Desktop.
//Get the action names for a particular controller type.
public static IEnumerable<String> ActionsFromController(this Type controllerType)
{
return controllerType.GetMethods(BindingFlags.Public | BindingFlags.Instance).OfType<MethodInfo>()
.Where(y=>typeof(IActionResult).IsAssignableFrom(y)).Select(y=>y.Name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment