public bool IsMatch(ILambdaRouteInfo routeInfo, string resource, string path, IDictionary <string, string> pathParameters, IEnumerable <string> verbs) { if (routeInfo.RouteAttribute == null) { return(false); } var matchString = pathParameters.Aggregate(routeInfo.RouteAttribute.Resource, (current, parameter) => current.Replace("{" + parameter.Key + "}", parameter.Value)); var verbMatch = routeInfo?.VerbAttribute == null ? true : !routeInfo.VerbAttribute.Verbs.Except(verbs).Any() && !verbs.Except(routeInfo.VerbAttribute.Verbs).Any(); var isMatch = (routeInfo.RouteAttribute.Resource.Equals(resource, StringComparison.CurrentCultureIgnoreCase) || matchString.Equals(path, StringComparison.InvariantCultureIgnoreCase)) && verbMatch; return(isMatch); }
public TResponse QuasWexExort(ILambdaRouteInfo routeInfo, object controllerInstance, object[] data) { var response = (TResponse)routeInfo?.MethodInfo.Invoke(controllerInstance, data); return(response); }
public async Task <TResponse> QuasWexExortAsync(ILambdaRouteInfo routeInfo, object controllerInstance, object[] data) { var response = await(Task <TResponse>) routeInfo.MethodInfo.Invoke(controllerInstance, data); return(response); }