public RestRoute(Type type, string path, string verbs, int priority)
{
this.HttpMethods = (verbs ?? Empty).Split(new[] { ',', ' ' }, StringSplitOptions.RemoveEmptyEntries);
this.Type = type;
this.Path = path;
this.Priority = priority;
this.queryProperties = GetQueryProperties(type);
foreach (var variableName in GetUrlVariables(path))
{
var safeVarName = variableName.TrimEnd('*');
RouteMember propertyInfo;
if (!this.queryProperties.TryGetValue(safeVarName, out propertyInfo))
{
this.AppendError($"Variable '{variableName}' does not match any property.");
continue;
}
this.queryProperties.Remove(safeVarName);
this.variablesMap[variableName] = propertyInfo;
}
}