private static bool IsMatchingVerb(string requestVerb, RestVerb expectedVerb) { string strB = null; switch (expectedVerb) { case RestVerb.Get: strB = "GET"; break; case RestVerb.Post: strB = "POST"; break; case RestVerb.Put: strB = "PUT"; break; case RestVerb.Delete: strB = "DELETE"; break; } return (string.Compare(requestVerb, strB, StringComparison.OrdinalIgnoreCase) == 0); }
private void InitializeVerb() { var restVerbAttr = MethodInfo.ReturnType.GetTypeInfo().GetCustomAttribute<RestVerbAttribute>(); Verb = restVerbAttr.Verb; }
public bool Match(RestVerb verb, string uri) { return this.Verb == verb && UriMatches(uri); }
public RestVerbAttribute(RestVerb verb) { Verb = verb; }