Created
November 18, 2011 10:14
-
-
Save ryansroberts/1376080 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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