Skip to content

Instantly share code, notes, and snippets.

@ryansroberts
Created November 18, 2011 10:14
Show Gist options
  • Save ryansroberts/1376080 to your computer and use it in GitHub Desktop.
Save ryansroberts/1376080 to your computer and use it in GitHub Desktop.
public class NoMethodActionDescriptor : ActionDescriptor {
public readonly string httpMethod;
public NoMethodActionDescriptor(string httpMethod)
{
this.httpMethod = httpMethod;
}
public override object Execute(ControllerContext controllerContext, IDictionary<string, object> parameters)
{
throw new HttpException(405,"No handler for method " + httpMethod);
}
public override ParameterDescriptor[] GetParameters()
{
return new ParameterDescriptor[] {};
}
public override string ActionName
{
get { return httpMethod; }
}
public override ControllerDescriptor ControllerDescriptor
{
get { return null; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment