public Route(string path, string methodName, Type controllerType)
{
if (String.IsNullOrWhiteSpace(path)) throw new ArgumentNullException("path");
if (String.IsNullOrWhiteSpace(methodName)) throw new ArgumentNullException("methodName");
Path = path;
Parameters = GetParameters(path);
PathTester = CreatePathTester(path);
ControllerType = controllerType;
HandlerInfo = controllerType.GetMethod(methodName);
HandlerParameters = HandlerInfo.GetParameters().ToDictionary(x => x.Name, x => x);
if (HandlerParameters.Count == 0 || HandlerParameters.First().Value.ParameterType != typeof(Action))
{
throw new InvalidOperationException("First argument of a route must be the 'next' delegate.");
}
}