private RouteAttribute BuildRouteAttribute(RestfulRouteConventionInfo convention) { switch (convention.HttpMethod) { case "GET": return new GETAttribute(convention.Url); case "POST": return new POSTAttribute(convention.Url); case "PUT": return new PUTAttribute(convention.Url); case "DELETE": return new DELETEAttribute(convention.Url); default: throw new AttributeRoutingException("Unknown HTTP method \"{0}\".".FormatWith(convention.HttpMethod)); } }
private IRouteAttribute BuildRouteAttribute(RestfulRouteConventionInfo convention) { switch (convention.HttpMethod) { case "GET": return(new GETAttribute(convention.Url)); case "POST": return(new POSTAttribute(convention.Url)); case "PUT": return(new PUTAttribute(convention.Url)); case "DELETE": return(new DELETEAttribute(convention.Url)); default: throw new AttributeRoutingException(StringExtensions.FormatWith("Unknown HTTP method \"{0}\".", convention.HttpMethod)); } }